Retire craton

Remove everything, add a README with explanation.

Change-Id: I7c8fcfac0d904f144b6a3838d25db0987d1e74a5
This commit is contained in:
Andreas Jaeger 2018-01-18 15:22:28 +01:00
parent 555d0c8856
commit e88f6b747a
137 changed files with 8 additions and 22469 deletions

View File

@ -1,7 +0,0 @@
[run]
branch = True
source = craton
omit = craton/openstack/*
[report]
ignore_errors = True

55
.gitignore vendored
View File

@ -1,55 +0,0 @@
*.py[cod]
# C extensions
*.so
# Packages
*.egg*
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
# Installer logs
pip-log.txt
# Unit test / coverage reports
cover/
.coverage*
!.coveragerc
.tox
nosetests.xml
.testrepository
.venv
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
# Complexity
output/*.html
output/*/index.html
# Sphinx
doc/build
# pbr generates these
AUTHORS
ChangeLog
# Editors
*~
.*.swp
.*sw?

View File

@ -1,4 +0,0 @@
[gerrit]
host=review.openstack.org
port=29418
project=openstack/craton.git

View File

@ -1,3 +0,0 @@
# Format is:
# <preferred e-mail> <other e-mail 1>
# <preferred e-mail> <other e-mail 2>

View File

@ -1,7 +0,0 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -1,23 +0,0 @@
Developer's Guide
-----------------
If you would like to contribute to the development of OpenStack, you must
follow the steps in this page:
http://docs.openstack.org/infra/manual/developers.html
Development Workflow
--------------------
If you already have a good understanding of how the system works and your
OpenStack accounts are set up, you can skip to the development workflow
section of this documentation to learn how changes to OpenStack should be
submitted for review via the Gerrit tool:
http://docs.openstack.org/infra/manual/developers.html#development-workflow
Engagement
----------
Pull requests submitted through GitHub will be ignored.
Bugs should be filed on Launchpad, not GitHub:
https://bugs.launchpad.net/craton

View File

@ -1,85 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
############################################################################
## Usage:
## docker build --pull -t craton-api:latest .
## docker run -t --name craton-api -p 127.0.0.1:7780:7780 -d craton-api:latest
## docker logs <container> and copy the username, api_key, and project_id
## python tools/generate_fake_data.py --url http://127.0.0.1:7780/v1 --user bootstrap --project <project-id from above> --key <api_key from above>
## Use the credentials from above to try different commands using python-cratonclient.
##############################################################################
# Get Ubuntu base image
FROM ubuntu:16.04
# File Author / Maintainer
MAINTAINER Sulochan Acharya
# Install required software and tools
RUN apt-get update \
&& apt-get install -y \
gcc \
git \
curl \
build-essential \
python3.5 \
python3.5-dev
# Get pip
ADD https://bootstrap.pypa.io/get-pip.py /root/get-pip.py
# Install pip
RUN python3.5 /root/get-pip.py
# Install MySQL 5.7
ENV MYSQL_ROOTPW root
RUN echo "mysql-server mysql-server/root_password password $MYSQL_ROOTPW" | debconf-set-selections && \
echo "mysql-server mysql-server/root_password_again password $MYSQL_ROOTPW" | debconf-set-selections
RUN apt-get install -y mysql-server-5.7 mysql-client-5.7
RUN service mysql start && \
mysqladmin -u root -p"$MYSQL_ROOTPW" password '' && \
service mysql stop
# Change mysql bind address
RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/mysql.conf.d/mysqld.cnf
# Install MySQL-python
RUN apt-get install -y libmysqlclient-dev python-mysqldb
# pip install virtualenv
RUN pip3 install virtualenv
# Expose port
EXPOSE 7780 3306
Add ./requirements.txt /requirements.txt
# Init virutalenv
RUN virtualenv -p /usr/bin/python3.5 /craton
# Change Working Dir
WORKDIR /craton
# Install requirements
RUN bin/pip install -r /requirements.txt
# pip install mysql-python
RUN bin/pip install mysqlclient
# Add Craton
ADD . /craton
# Install Craton
RUN bin/pip install .
CMD ["tools/docker_run.sh"]

View File

@ -1,4 +0,0 @@
craton Style Commandments
===============================================
Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/

176
LICENSE
View File

@ -1,176 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

View File

View File

@ -1,29 +1,10 @@
Craton
======
This project is no longer maintained.
Craton is a new project we plan to propose for OpenStack inclusion.
Craton supports deploying and operating OpenStack clouds by providing
scalable fleet management:
The contents of this repository are still available in the Git
source code management system. To see the contents of this
repository before it reached its end of life, please check out the
previous commit with "git checkout HEAD^1".
* Inventory of configurable physical devices/hosts (the fleet)
* Audit and remediation workflows against this inventory
* REST APIs, CLI, and Python client to manage
Support for workflows, CLI, and the Python client is in progress.
For more information, please refer to the following project resources:
* **Free software:** under the `Apache license <http://www.apache.org/licenses/LICENSE-2.0>`_
* **Documentation:** https://craton.readthedocs.io
* **Source:** https://github.com/openstack/craton
* **Blueprints:** https://blueprints.launchpad.net/craton
* **Bugs:** https://bugs.launchpad.net/craton
For information on how to contribute to Craton, please see the
contents of the `CONTRIBUTING.rst file <CONTRIBUTING.rst>`_.
For information on how to setup a Developer's Environment, please
see the contents of `INSTALL.RST file <doc/source/dev/install.rst>`_.
For more information on Craton distribution license, please see
the contents of the `LICENSE file <LICENSE>`_.
For any further questions, please email
openstack-dev@lists.openstack.org or join #openstack-dev on
Freenode.

View File

@ -1,273 +0,0 @@
.. -*- rst -*-
======
Cells
======
Definition of cell
Create Cell
============
.. rest_method:: POST /v1/cells
Create a new Cell
Normal response codes: OK(201)
Error response codes: invalid request(400), validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- name : cell_name
- region_id: region_id_body
- project_id: project_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
**Example Create Cell** (TO-DO)
..literalinclude:: ../../doc/api_samples/cells/cells-create-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- cell: cell
- id: cell_id_body
- name: cell_name
- region_id: region_id_body
- project_id: project_id
- note: note
- variables: variables
**Example Create Cell** (TO-DO)
..literalinclude:: ../../doc/api_samples/cells/cells-create-resp.json
:language: javascript
List Cells
==========
.. rest_method:: GET /v1/cells
Gets all Cells
Normal response codes: OK(200)
Error response codes: invalid request(400), cell not found(404), validation exception(405)
Default response: unexpected error
Request
--------
.. rest_parameters:: parameters.yaml
- cell: cell_name_query
- region: region_name_query
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
Response
--------
.. rest_parameters:: parameters.yaml
- cells: cells
- id: cell_id_body
- name: cell_name
- region_id: region_id_body
- project_id: project_id
- note: note
- variables: variables
**Example List Cells** (TO-DO)
..literalinclude:: ../../doc/api_samples/cells/cells-list-resp.json
:language: javascript
**Example Unexpected Error **
..literalinclude:: ../../doc/api_samples/errors/errors-unexpected-resp.json
:language: javascript
Update Cells
============
.. rest_method:: PUT /v1/cells/{cell_id}
Update an existing cell
Normal response codes: OK(200)
Error response codes: invalid request(400), cell not found(404), validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- id: cell_id_body
- name: cell_name
- region_id: region_id_body
- project_id: project_id
- note: note
- variables: variables
- cell_id: cell_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
**Example Update Cell** (TO-DO)
..literalinclude:: ../../doc/api_samples/cells/cells-update-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- cell: cell
- id: cell_id_body
- name: cell_name
- region_id: region_id_body
- project_id: project_id
- note: note
- variables: variables
**Example Update Cell** (TO-DO)
..literalinclude:: ../../doc/api_samples/cells/cells-update-resp.json
:language: javascript
Update Cell Data
==================
.. rest_method:: PUT /v1/cells/{cell_id}/variables
Update user defined variables for the cell
Normal response codes: OK(200)
Error response codes: invalid request(400), cell not found(404), validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- key: key
- value: value
- cell_id: cell_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
**Example Update Cell Data** (TO-DO)
..literalinclude:: ../../doc/api_samples/cells/cells-upadate—data-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- key: key
- value: value
**Example Update Cell Data** (TO-DO)
..literalinclude:: ../../doc/api_samples/cells/cells-update-data-resp.json
:language: javascript
Delete Cell
===========
.. rest_method:: DELETE /v1/cells/{cell_id}
Deletes an existing record of a Cell
Normal response codes: OK(200)
Error response codes: invalid request(400), cell not found(404)
Request
-------
.. rest_parameters:: parameters.yaml
- cell_id: cell_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
Response
--------
No body content is returned on a successful DELETE
Delete Cell Data
================
.. rest_method:: DELETE /v1/cells/{cell_id}/variables
Delete existing key/value variable for the cell
Normal response codes: OK(200)
Error response codes: invalid request(400), cell not found(404) validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- cell_id: cell_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
Response
--------
No body content is returned on a successful DELETE

View File

@ -1,301 +0,0 @@
.. -*- rst -*-
=====
Hosts
=====
Definition of host
Create Host
============
.. rest_method:: POST /v1/hosts
Create a new host
Normal response codes: OK(201)
Error response codes: invalid request(400), validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- name: host_name
- region_id: region_id_body
- project_id: project_id
- ip_address: ip_address
- device_type: device_type
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
**Example Create Host** (TO-DO)
..literalinclude:: ../../doc/api_samples/hosts/hosts-create-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- host: host
- id: host_id_body
- name: host_name
- cell_id: cell_id_body
- parent_id: parent_id
- project_id: project_id
- region_id: region_id_body
- ip_address: ip_address
- device_type: device_type
- labels: labels
- note: note
- variables: variables
**Example Create Host** (TO-DO)
..literalinclude:: ../../doc/api_samples/hosts/hosts-create-resp.json
:language: javascript
List Hosts
==========
.. rest_method:: GET /v1/hosts
Gets all Host
Normal response codes: OK(200)
Error response codes: invalid request(400), host not found(404), validation exception(405)
Default response: unexpected error
Request
--------
.. rest_parameters:: parameters.yaml
- limit: limit
- name: host_name_query
- id: host_id_query
- region: region_name_query
- cell: cell_name_query
- ip_address: ip_address_query
- service: service
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
Response
--------
.. rest_parameters:: parameters.yaml
- hosts: hosts
- id: host_id_body
- name: host_name
- cell_id: cell_id_body
- parent_id: parent_id
- project_id: project_id
- region_id: region_id_body
- ip_address: ip_address
- device_type: device_type
- labels: labels
- note: note
- variables: variables
**Example List Host** (TO-DO)
..literalinclude:: ../../doc/api_samples/hosts/hosts-list-resp.json
:language: javascript
**Example Unexpected Error **
..literalinclude:: ../../doc/api_samples/errors/errors-unexpected-resp.json
:language: javascript
Update Hosts
============
.. rest_method:: PUT /v1/hosts/{host_id}
Update an existing host
Normal response codes: OK(200)
Error response codes: invalid request(400), host not found(404), validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- id: host_id_body
- name: host_name
- cell_id: cell_id_body
- parent_id: parent_id
- project_id: project_id
- region_id: region_id_body
- ip_address: ip_address
- device_type: device_type
- labels: labels
- note: note
- variables: variables
- host_id: host_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
**Example Update Host** (TO-DO)
..literalinclude:: ../../doc/api_samples/hosts/hosts-update-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- host: host
- id: host_id_body
- name: host_name
- cell_id: cell_id_body
- parent_id: parent_id
- project_id: project_id
- region_id: region_id_body
- ip_address: ip_address
- device_type: device_type
- labels: labels
- note: note
- variables: variables
**Example Update Host** (TO-DO)
..literalinclude:: ../../doc/api_samples/hosts/hosts-update-resp.json
:language: javascript
Update Host Data
==================
.. rest_method:: PUT /v1/hosts/{host_id}/variables
Update user defined variables for the host
Normal response codes: OK(200)
Error response codes: invalid request(400), host not found(404), validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- key: key
- value: value
- host_id: host_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
**Example Update Host Data** (TO-DO)
..literalinclude:: ../../doc/api_samples/hosts/hosts-upadate—data-req.json
:language: javascript
Response
--------
.. rest_parameters:: parameters.yaml
- key: key
- value: value
**Example Update Host Data** (TO-DO)
..literalinclude:: ../../doc/api_samples/hosts/hosts-update-data-resp.json
:language: javascript
Delete Host
===========
.. rest_method:: DELETE /v1/hosts/{host_id}
Deletes an existing record of a Host
Normal response codes: OK(200)
Error response codes: invalid request(400), host not found(404)
Request
-------
.. rest_parameters:: parameters.yaml
- host_id: host_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
Response
--------
No body content is returned on a successful DELETE
Delete Host Data
================
.. rest_method:: DELETE /v1/hosts/{host_id}/variables
Delete existing key/value variables for the Host
Normal response codes: OK(200)
Error response codes: invalid request(400), host not found(404) validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- host_id: host_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
Response
--------
No body content is returned on a successful DELETE

View File

@ -1,11 +0,0 @@
:tocdepth: 2
===========
Craton API
===========
.. rest_expand_all::
.. include:: cells.inc
.. include:: hosts.inc
.. include:: regions.inc

View File

@ -1,201 +0,0 @@
# variables in header
Content-Type:
description: |
Type of content sent using cURL
in: header
required: true
type: string
X-Auth-Project:
description: |
ID of the project this user is assigned to.
in: header
required: true
type: integer
X-Auth-Token:
description: |
User authentication token for the current session
in: header
required: true
type: string
X-Auth-User
description: |
User of the current session
in: header
required: true
type: string
# variables in path
cell_id:
description: |
The unique ID of the cell
in: path
required: true
type: integer
host_id:
description: |
The unique ID of the host
region_id:
description: |
The unique ID of the region
in: path
required: true
type: integer
# variables in body
cell:
description: |
A cell object
in: body
required: false
type: object
cell_id_body:
description: |
Unique ID of the cell
in: body
required: false
type: integer
cell_name:
description: |
Unique name of the cell
in: body
required: true
type: string
cells:
description: |
An array of cell objects
in: body
required: false
type: array
variables:
description: |
User defined information
in: body
required: false
type: object
device_type:
description: |
Type of host
in: body
required: false
type: string
host:
description: |
A host object
in: body
required: false
type: object
host_id_body:
description: |
Unique ID of the host
in: body
required: false
type: integer
host_name:
description: |
Unique name of the host
hosts:
description: |
An array of host objects
in: body
required: false
type: array
ip_address:
description: |
IP address
in: body
type: string
labels:
description: |
User defined labels
in: body
required: false
type: string
parent_id:
description: |
Parent ID of this host
in: body
required: false
type: integer
project_id:
description: |
ID of the project
in: body
required: true
type: integer
note:
description: |
Note used for governance
in: body
required: false
type: string
region:
description: |
A region object
in: body
required: false
type: object
region_id_body:
description: |
The unique ID of the region
in: body
required: false
type: integer
region_name:
description: |
Unique name of the region
in: body
required: true
type: string
regions:
description: |
An array of region objects
in: body
required: true
type: array
# variables in query
cell_name_query:
description: |
Name of the cell to get
in: query
required: false
type: string
ip_address_query:
description: |
IP address to get
in: query
required: false
type: string
host_id_query:
description: |
ID of the host to get
in: query
required: false
type: integer
host_name_query:
description: |
Name of host to get
in: query
required: false
type: string
limit:
description: |
Number of host to return ranging from 1 - 10000. Default = 1000
in: query
required: false
type: integer
region_id_query:
description: |
ID of the region to get
in: query
required: false
type: string
region_name_query:
description: |
Name of the the region to get
in: query
required: false
type: string
service:
description: |
Openstack service to query host by
in: query
required: false
type: array

View File

@ -1,260 +0,0 @@
.. -*- rst -*-
=======
Regions
=======
Definition of region
Create Region
==============
.. rest_method:: POST /v1/region
Creates a new Region
Normal response codes: OK(201)
Error response codes: invalid request(400), validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- name: region_name
- project_id: project_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
**Example Create Region**
..literalinclude:: ../../doc/api_samples/regions/regions-create-req.json
:language: javascript
Response
--------
- region: region
- id: region_id_body
- name: region_name
- project_id: project_id
- cells: cells
- variables: variables
**Example Create Region**
..literalinclude:: ../../doc/api_samples/regions/regions-create-resp.json
:language: javascript
List Regions
==============
.. rest_method:: GET /v1/regions
Gets all Regions
Normal response codes: OK(200)
Error response codes: invalid request(400), validation exception(405)
Default response: unexpected error
Request
--------
- name: region_name_query
- id: region_id_query
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
Response
--------
.. rest_parameters:: parameters.yaml
- region: region
- id: region_id_body
- name: region_name
- project_id: project_id
- cells: cells
- variables: variables
**Example List Regions**
..literalinclude:: ../../doc/api_samples/regions/regions-list-resp.json
:language: javascript
**Example Unexpected Error **
..literalinclude:: ../../doc/api_samples/errors/errors-unexpected-resp.json
:language: javascript
Update Region
=============
.. rest_method:: PUT /v1/regions/{region_id}
Update an existing region
Normal response codes: OK(200)
Error response codes: invalid request(400), region not found(404), validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- id: region_id_body
- name: region_name
- project_id: project_id
- cells: cells
- variables: variables
- region_id: region_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
**Example Update Region** (TO-DO)
..literalinclude:: ../../doc/api_samples/regions/regions-update-req.json
:language: javascript
Response
--------
- region: region
- id: region_id_body
- name: region_name
- project_id: project_id
- cells: cells
- variables: variables
**Example Update Region** (TO-DO)
..literalinclude:: ../../doc/api_samples/regions/regions-update-resp.json
:language: javascript
Update Region Data
==================
.. rest_method:: PUT /v1/regions/{region_id}/variables
Update user defined variables for the region
Normal response codes: OK(200)
Error response codes: invalid request(400), region not found(404), validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- key: key
- value: value
- region_id: region_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
**Example Update Region Data** (TO-DO)
..literalinclude:: ../../doc/api_samples/regions/regions-upadate—data-req.json
:language: javascript
Response
--------
- key: key
- value: value
**Example Update Region Data** (TO-DO)
..literalinclude:: ../../doc/api_samples/regions/regions-update-data-resp.json
:language: javascript
Delete Region
==============
.. rest_method:: DELETE /v1/regions/{region_id}
Deletes an existing record of a Region
Normal response codes: OK(200)
Error response codes: invalid request(400), region not found(404)
Request
-------
.. rest_parameters:: parameters.yaml
- region_id: region_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
Response
--------
No body content is returned on a successful DELETE
Delete Region Data
==================
.. rest_method:: DELETE /v1/regions/{region_id}/variables
Delete existing key/value variables for the region
Normal response codes: OK(200)
Error response codes: invalid request(400), region not found(404) validation exception(405)
Request
-------
.. rest_parameters:: parameters.yaml
- region_id: region_id
Required Header
^^^^^^^^^^^^^^^
- Content-Type: Content_Type
- X-Auth-Token: X-Auth-Token
- X-Auth-User: X-Auth-User
- X-Auth-Project: X-Auth-Project
Response
--------
No body content is returned on a successful DELETE

View File

@ -1,2 +0,0 @@
[python: **.py]

View File

@ -1 +0,0 @@
docker.io [platform:dpkg]

View File

@ -1,19 +0,0 @@
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import pbr.version
__version__ = pbr.version.VersionInfo(
'craton').version_string()

View File

@ -1,19 +0,0 @@
"""oslo.i18n integration module.
See http://docs.openstack.org/developer/oslo.i18n/usage.html
"""
import oslo_i18n
_translators = oslo_i18n.TranslatorFactory(domain='craton')
# The primary translation function using the well-known name "_"
_ = _translators.primary
# The contextual translation function using the name "_C"
_C = _translators.contextual_form
# The plural translation function using the name "_P"
_P = _translators.plural_form

View File

@ -1,75 +0,0 @@
import os
from paste import deploy
from flask import Flask
from oslo_config import cfg
from oslo_log import log as logging
from craton.api import v1
from craton.util import JSON_KWARGS
LOG = logging.getLogger(__name__)
api_opts = [
cfg.StrOpt('api_paste_config',
default="api-paste.ini",
help="Configuration file for API service."),
cfg.StrOpt('paste_pipeline',
default="local-auth",
choices=["local-auth", "keystone-auth"],
help="""\
The name of the Paste pipeline to use for Craton.
Pipelines are organized according to authentication scheme. The available
choices are:
- ``local-auth`` (the default) Uses Craton's default authentication and
authorization scheme
- ``keystone-auth`` Uses Keystone for identity, authentication, and
authorization
"""),
cfg.StrOpt('host',
default="127.0.0.1",
help="API host IP"),
cfg.IntOpt('port',
default=5000,
help="API port to use.")
]
CONF = cfg.CONF
opt_group = cfg.OptGroup(name='api',
title='Craton API service group options')
CONF.register_group(opt_group)
CONF.register_opts(api_opts, opt_group)
def create_app(global_config, **local_config):
return setup_app()
def setup_app(config=None):
app = Flask(__name__, static_folder=None)
app.config.update(
PROPAGATE_EXCEPTIONS=True,
RESTFUL_JSON=JSON_KWARGS,
)
app.register_blueprint(v1.bp, url_prefix='/v1')
return app
def load_app(