Remove outdated documentation
This documentation covers code written during the Havana release cycle. This was all deleted during Icehouse and thus the version 1 that it refers no longer exists. Change-Id: Ibcc3595b2217dae5e3866cebd5b4cf67124aa1fa
This commit is contained in:
parent
61e5acc3af
commit
f31790639a
@ -1,317 +0,0 @@
|
||||
# Tuskar API Draft
|
||||
|
||||
## ERD diagram:
|
||||
|
||||
* 05-30-2013: [version 1.0](./img/model_v1.jpg)
|
||||
* 06-03-2013: [version 2.0](./img/model_v2.jpg)
|
||||
* 06-04-2013: [version 3.0](./img/model_v3.jpg)
|
||||
* 16-07-2013: [version 4.0](./img/model_v4.jpg)
|
||||
|
||||
## Introduction and Concepts
|
||||
|
||||
The main resources in the Tuskar API are:
|
||||
<a name="index"></a>
|
||||
|
||||
* [ResourceClass](#resource_class)
|
||||
A ResourceClass can be thought of as a cloud 'building block'. It has a
|
||||
'type' that describes its purpose ('compute' or 'storage' for example).
|
||||
A ResourceClass consists of a set of hardware racks and defines the types
|
||||
of VM instances that can be supported by the physical Nodes in those Racks
|
||||
|
||||
* [Rack](#rack)
|
||||
A Rack can be thought of as a server Rack in a datacenter. It is a grouping
|
||||
of physical compute nodes that are assigned to a given ResourceClass and
|
||||
can be managed as a single unit.
|
||||
|
||||
* [Flavor](#flavor)
|
||||
A Flavor is a hardware configuration and its definition is aligned with the
|
||||
"instance_type" (aka 'Flavor') used in the OpenStack
|
||||
[Nova API](http://docs.openstack.org/api/openstack-compute/2/content/concepts.html).
|
||||
Flavors are defined for a given ResourceClass and semantically describe
|
||||
the types of compute instances that can be launched for that
|
||||
ResourceClass. Each Flavor has a set of Capacities that describe a particular
|
||||
aspect of the hardware configuration, such as cpu, memory or storage.
|
||||
|
||||
* [Capacity](#capacity)
|
||||
This is an abstraction used by both the Flavor and the Rack models. A given
|
||||
Capacity describes a particular aspect of a hardware configuration - such as
|
||||
cpu, memory, or storage. A Flavor is defined by a set of Capacities whilst
|
||||
a Rack maintains the aggregate Capacities of the Nodes it contains.
|
||||
|
||||
* [Node](#node)
|
||||
A Node is a single physical compute unit. A Rack resource consists of a
|
||||
number of Nodes and each Node corresponds to a compute Node in Nova Bare
|
||||
Metal (or eventually, in Ironic).
|
||||
|
||||
## Types
|
||||
|
||||
| Name | Explanation |
|
||||
|:--------------|:------------------------------------------------------------------|
|
||||
| `String` | JSON string |
|
||||
| `URL` | Absolute URL |
|
||||
| `Array[T]` | Array where each entry has type T |
|
||||
| `Ref[T]` | A reference to a T, used to model relations, the T is a valid Resource indentifier |
|
||||
| `Struct` | A structure with sub-attributes |
|
||||
| `Collection` | Grouping of resources containing an Array of resources of type T, as well as attributes and actions for the grouping |
|
||||
|
||||
## Common attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|---------------|----------------------------|--------------------------------------------|
|
||||
| id | Ref(self) | Resource identifier |
|
||||
| name | String | Human readable name |
|
||||
|
||||
<hr/>
|
||||
|
||||
## ResourceClass
|
||||
<a name="resource_class"></a>
|
||||
|
||||
The ResourceClass describes the list of instance types (flavors) and the
|
||||
array of references to the Rack that provides a computing or storage capacities.
|
||||
The *service_type* attribute describe whether this ResourceClass is *storage* or
|
||||
*computing*.
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|---------------|----------------------------|--------------------------------------------------------------|
|
||||
| service_type | String | Type of service this class will provide Compute or Storage |
|
||||
| flavors | Array(Struct(Flavor)) | List of Flavor definitions and maximum amount of supported machines for this Flavor type|
|
||||
| racks | Collection | Collection of Rack resources available for this class |
|
||||
|
||||
#### ResourceClass example JSON serialization
|
||||
|
||||
```json
|
||||
{
|
||||
"id" : "/resource_classes/1",
|
||||
"name" : "m1",
|
||||
"service_type" : "compute",
|
||||
"flavors" : [
|
||||
{ "name" : "x-large",
|
||||
"count": 8,
|
||||
"capacities" : [
|
||||
{ "name": "cpu",
|
||||
"value" : "4",
|
||||
"unit" : "count" },
|
||||
{ "name": "memory",
|
||||
"value" : "8192",
|
||||
"unit" : "MiB" },
|
||||
{ "name": "storage",
|
||||
"value" : "1024",
|
||||
"unit" : "GiB" }
|
||||
]
|
||||
},
|
||||
{ "name" : "medium",
|
||||
"count": 16,
|
||||
"capacities" : [
|
||||
{ "name": "cpu",
|
||||
"value" : "2",
|
||||
"unit" : "count" },
|
||||
{ "name": "memory",
|
||||
"value" : "4096",
|
||||
"unit" : "MiB" },
|
||||
{ "name": "storage",
|
||||
"value" : "1024",
|
||||
"unit" : "GiB" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"racks" : [
|
||||
{
|
||||
"id":1,
|
||||
"links":[
|
||||
{ "href":"http://0.0.0.0:8585/v1/rack/1",
|
||||
"rel":"self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
[back to top](#index)
|
||||
<hr/>
|
||||
|
||||
|
||||
## Flavor
|
||||
<a name="flavor"></a>
|
||||
|
||||
Flavor is an available hardware configuration for a server and is defined by
|
||||
an array of capacities. Each capacity defines a particular aspect of the
|
||||
hardware configuration with a fixed value, such as memory, cpu, storage,
|
||||
network or any other relevant hardware configuration information.
|
||||
|
||||
A Flavor only exists within the context of a specific ResourceClass. That is,
|
||||
a Flavor cannot be referenced, retrieved, created, deleted or updated as a
|
||||
stand-alone resource. All operations on Flavor are performed for a specific
|
||||
ResourceClass.
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|-------------------|-----------------------------|--------------------------------------------------------------|
|
||||
| capacities | Array(Capacity) | An array of capacity definitions used by this flavor |
|
||||
|
||||
#### Flavor example JSON serialization
|
||||
|
||||
```json
|
||||
{
|
||||
"id" : "/resource_class/1/flavors/123",
|
||||
"name" : "micro",
|
||||
"capacities" : [
|
||||
{
|
||||
"name" : "cpu",
|
||||
"value" : "1",
|
||||
"unit" : "count"
|
||||
},
|
||||
{
|
||||
"name" : "memory",
|
||||
"value" : "1024",
|
||||
"unit" : "MB"
|
||||
},
|
||||
{
|
||||
"name" : "storage",
|
||||
"value" : "5",
|
||||
"unit" : "GB"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
[back to top](#index)
|
||||
<hr/>
|
||||
|
||||
## Capacity
|
||||
<a name="capacity"></a>
|
||||
This model is used to provide the fixed values for the Flavor model and the
|
||||
aggregate capacity values of all Nodes in a given Rack.
|
||||
|
||||
The Capacity model does not have any ID because it is an abstraction model rather
|
||||
than a realized resource.
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|------------|-----------------------|-----------------------------------------------------------------|
|
||||
| name | String | A name of the capacity, eg. 'cpu', 'memory', 'storage' |
|
||||
| value | String | A capacity value, eg. '1024' |
|
||||
| unit | String | Unit used for the value |
|
||||
|
||||
#### Capacity example JSON serialization
|
||||
|
||||
```json
|
||||
{
|
||||
"name" : "cpu",
|
||||
"value" : "6",
|
||||
"unit" : "count"
|
||||
}
|
||||
```
|
||||
|
||||
```json
|
||||
{
|
||||
"name" : "memory",
|
||||
"value" : "1024",
|
||||
"unit" : "GB"
|
||||
}
|
||||
```
|
||||
|
||||
[back to top](#index)
|
||||
<hr/>
|
||||
|
||||
## Rack
|
||||
<a name="rack"></a>
|
||||
A Rack represents a grouping of Node resources, assigned to a given
|
||||
class as a single unit. Each Rack has a total number of slots available for
|
||||
Nodes, represented by the `slots` attribute. A Rack references the ResourceClass
|
||||
to which it belongs to as well as an array of references to the Node resources
|
||||
that the Rack is comprised of. Finally, each Rack resource contains an array
|
||||
of references to Capacity resources that represent the aggregate capacity
|
||||
of the nodes making up this Rack.
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|-----------------|--------------------------|----------------------------------------------------------------------------|
|
||||
| slots | String | Number of slots that physical rack chassis has. Used for capacity planning |
|
||||
| resource_class | Ref(ResourceClass)) | Reference to a ResourceClass current Rack belongs to |
|
||||
| capacities | Array(Capacity) | Aggregate Capacities of the nodes that this Rack is comprised of |
|
||||
| nodes | Collection | Collection of the Nodes that rack contains |
|
||||
| subnet | String | A network subnet where the Rack belongs to (192.168.1.0/24) (CIDR format) |
|
||||
| location | String | Identifier for the physical location of the Rack in the datacenter |
|
||||
| status | String | Current status of the Rack, e.g. 'Provisioned'
|
||||
|
||||
#### Rack example JSON serialization
|
||||
|
||||
```json
|
||||
{
|
||||
"id" : "/racks/1",
|
||||
"name" : "Dell001",
|
||||
"slots" : "30",
|
||||
"subnet" : "192.168.1.0/24",
|
||||
"location" : "East1",
|
||||
"resource_class" : { "href" : "/resource_classes/1" },
|
||||
"capacities" : [
|
||||
{
|
||||
"name" : "total_cpu",
|
||||
"value" : "12",
|
||||
"unit" : "count"
|
||||
},
|
||||
{
|
||||
"name" : "total_memory",
|
||||
"value" : "3072",
|
||||
"unit" : "MB"
|
||||
}
|
||||
],
|
||||
"nodes" : [
|
||||
{ "id": "123" },
|
||||
{ "id": "345"}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
[back to top](#index)
|
||||
<hr/>
|
||||
|
||||
## Node
|
||||
<a name="node"></a>
|
||||
A Node represents a single physical compute unit. Each Node includes a
|
||||
reference to the Rack resource that it is assigned to via the `rack`
|
||||
attribute. Each node has a `baremetal_node` attribute which references the
|
||||
physical machine as represented within the Ironic API; this will allow
|
||||
discovery of the Nodes compute, memory and storage capacities as well as
|
||||
other relevant attributes such as its MAC address.
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|------------------|--------------------------|---------------------------------------------------------|
|
||||
| rack | Ref(Rack) | A reference to the Rack where Node is located |
|
||||
| baremetal_node | URL | A reference to Baremetal API that contains Node details |
|
||||
| capacities | Array(Struct(Capacity)) | Total capacity of the Node (mem, cpu, storage,...) |
|
||||
| mac_address | String | MAC address of the network interface attached to Node |
|
||||
| ip_address | String | IP address of the Node network interface (if available) |
|
||||
| driver | String | Ironic deployment driver (PXE, etc...) |
|
||||
| power_driver | Struct | Ironic power driver and properties (IPMI username, etc.)|
|
||||
|
||||
TBD: Is not clear how much attrs we need to include in this model.
|
||||
|
||||
#### Node example JSON serialization
|
||||
|
||||
```json
|
||||
{
|
||||
"id" : "/nodes/1",
|
||||
"name" : "dell-per-601-1",
|
||||
"rack" : { "href" : "/racks/1" },
|
||||
"capacities" : [
|
||||
{
|
||||
"name" : "cpu",
|
||||
"value" : "6",
|
||||
"unit" : "count"
|
||||
},
|
||||
{
|
||||
"name" : "memory",
|
||||
"value" : "8192",
|
||||
"unit" : "MB"
|
||||
}
|
||||
],
|
||||
"baremetal_node" : { "href" : "http://server/nodes/123" },
|
||||
"mac_address" : "00:B0:D0:86:BB:F7",
|
||||
"ip_address" : "192.168.1.2",
|
||||
"deploy_driver" : "pxe",
|
||||
"power_driver" : {
|
||||
"name" : "ipmi",
|
||||
"username" : "root",
|
||||
"password" : "calvin"
|
||||
}
|
||||
}
|
||||
```
|
||||
[back to top](#index)
|
@ -1,447 +0,0 @@
|
||||
=============
|
||||
cURL Commands
|
||||
=============
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
||||
- `Rack <#rack>`_
|
||||
- `Flavor <#flavor>`_
|
||||
- `ResourceClass <#resource_class>`_
|
||||
- `DataCenter <#data_center>`_
|
||||
- `Node <#node>`_
|
||||
- `Overcloud <#overcloud>`_
|
||||
|
||||
Rack
|
||||
----
|
||||
|
||||
create
|
||||
~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -vX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '
|
||||
{
|
||||
"subnet": "192.168.1.0/255",
|
||||
"name": "my_rack",
|
||||
"capacities": [{
|
||||
"name": "total_cpu",
|
||||
"value": "64",
|
||||
"unit": "count"
|
||||
}, {
|
||||
"name": "total_memory",
|
||||
"value": "1024",
|
||||
"unit": "MiB"
|
||||
}],
|
||||
"nodes": [{
|
||||
"id": "123"
|
||||
}, {
|
||||
"id": "345"
|
||||
}],
|
||||
"slots": 1
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/racks
|
||||
|
||||
create with ResourceClass
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -vX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '
|
||||
{
|
||||
"subnet": "192.168.1.0/255",
|
||||
"name": "my_rack",
|
||||
"capacities": [{
|
||||
"name": "total_cpu",
|
||||
"value": "64",
|
||||
"unit": "cpu"
|
||||
}, {
|
||||
"name": "total_memory",
|
||||
"value": "1024",
|
||||
"unit": "MB"
|
||||
}],
|
||||
"nodes": [{
|
||||
"id": "123"
|
||||
}, {
|
||||
"id": "345"
|
||||
}],
|
||||
"slots": 1,
|
||||
"resource_class":{
|
||||
"id":1,
|
||||
"links":[
|
||||
{
|
||||
"href":"http://0.0.0.0:8585/v1/resource_clases/1",
|
||||
"rel":"self"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/racks
|
||||
|
||||
delete
|
||||
~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -vX DELETE http://localhost:8585/v1/racks/1
|
||||
|
||||
update
|
||||
~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -v -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '{ "name": "new_name" }' http://0.0.0.0:8585/v1/racks/1
|
||||
|
||||
update (change nodes to Rack 1)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -v -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '{ "nodes": [ { "id": "1" }, { "id": "2"}] }' http://0.0.0.0:8585/v1/racks/1
|
||||
|
||||
`back to top <#index>`_
|
||||
|
||||
Flavor
|
||||
------
|
||||
|
||||
This resource only exists as part of a ResourceClass.
|
||||
|
||||
create a new Flavor for a specific ResourceClass
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -v -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '
|
||||
{
|
||||
"max_vms": 10,
|
||||
"name": "tiny",
|
||||
"capacities":
|
||||
[
|
||||
{
|
||||
"value": "1",
|
||||
"name": "cpu",
|
||||
"unit": "count"
|
||||
},
|
||||
{
|
||||
"value": "512",
|
||||
"name": "memory",
|
||||
"unit": "MiB"
|
||||
},
|
||||
{
|
||||
"value": "512",
|
||||
"name": "storage",
|
||||
"unit": "GiB"
|
||||
}
|
||||
]
|
||||
}'
|
||||
http://0.0.0.0:8585/v1/resource_classes/1/flavors``
|
||||
|
||||
Flavors can also be created as part of `ResourceClass create <#rc_with_flavors>`_ operation:
|
||||
|
||||
get Flavor(s) for a particular ResourceClass
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -H "Accept: application/xml" http://0.0.0.0:8585/v1/resource_classes/1/flavors(/2)
|
||||
|
||||
delete a specific Flavor from a given ResourceClass
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -X DELETE -H "Accept: application/xml" http://0.0.0.0:8585/v1/resource_classes/1/flavors/1
|
||||
|
||||
update an existing Flavor in a specified ResourceClass
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -v -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '
|
||||
{
|
||||
"capacities":
|
||||
[
|
||||
{
|
||||
"value": "5000",
|
||||
"name": "cpu",
|
||||
"unit": "count"
|
||||
},
|
||||
{
|
||||
"value": "1111",
|
||||
"name": "memory",
|
||||
"unit": "MiB"
|
||||
},
|
||||
{
|
||||
"value": "2222",
|
||||
"name": "storage",
|
||||
"unit": "GiB"
|
||||
}
|
||||
],
|
||||
"max_vms": 9999,
|
||||
"name": "tiny_update" }'
|
||||
http://0.0.0.0:8585/v1/resource_classes/1/flavors/3``
|
||||
|
||||
**NOTE:** The above operation can be performed to change only part of a
|
||||
given flavor - such as updating the name or max\_vms, or even a specific
|
||||
capacity. The body of the PUT request will determine what is updated.
|
||||
For example, to update the 'cpu' capacity and 'max\_vms':
|
||||
|
||||
::
|
||||
|
||||
curl -v -X PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '
|
||||
{
|
||||
"max_vms": 1234,
|
||||
"capacities" : [
|
||||
{ "name": "cpu",
|
||||
"value" : "1",
|
||||
"unit" : "count" }
|
||||
]
|
||||
}'
|
||||
http://0.0.0.0:8585/v1/resource_classes/1/flavors/3``
|
||||
|
||||
`back to top <#index>`_
|
||||
|
||||
ResourceClass
|
||||
-------------
|
||||
|
||||
get a specific ResourceClass
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes/1
|
||||
|
||||
response
|
||||
^^^^^^^^
|
||||
|
||||
::
|
||||
|
||||
{
|
||||
"id":11,
|
||||
"name":"test-chassis",
|
||||
"service_type":"compute",
|
||||
"racks":[
|
||||
{
|
||||
"id":1,
|
||||
"links":[
|
||||
{
|
||||
"href":"http://0.0.0.0:8585/v1/rack/1",
|
||||
"rel":"self"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"links":[
|
||||
{
|
||||
"href":"http://0.0.0.0:8585/v1/resource_classes/11",
|
||||
"rel":"self"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
get collection
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes
|
||||
|
||||
create without Racks
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -iX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
|
||||
{
|
||||
"service_type": "compute",
|
||||
"name": "test-chassis"
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/resource_classes
|
||||
|
||||
create with Rack and Flavor definitions
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -iX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
|
||||
{
|
||||
"name": "test-chassis",
|
||||
"service_type":"compute",
|
||||
"racks": [
|
||||
{ "id":1,
|
||||
"links":[{"href":"http://0.0.0.0:8585/v1/racks/1","rel":"self"}]
|
||||
}
|
||||
],
|
||||
"flavors": [
|
||||
{ "name" : "x-large",
|
||||
"capacities" : [
|
||||
{ "name": "cpu",
|
||||
"value" : "4",
|
||||
"unit" : "count" },
|
||||
{ "name": "memory",
|
||||
"value" : "8192",
|
||||
"unit" : "MiB" },
|
||||
{ "name": "storage",
|
||||
"value" : "1024",
|
||||
"unit" : "GiB" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/resource_classes
|
||||
|
||||
**as a one-liner (copy/paste)**
|
||||
|
||||
::
|
||||
|
||||
curl -iX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"service_type": "compute_1","name": "test-chassis", "service_type":"compute","racks":[{"id":1,"links":[{"href":"http://0.0.0.0:8585/v1/racks/1","rel":"self"}]}], "flavors": [{"name" : "x-large", "capacities" : [ { "name": "cpu", "value" : "4", "unit" : "count" }, { "name": "memory", "value" : "8192", "unit" : "MiB" }, { "name": "storage", "value" : "1024", "unit" : "GiB" }]}]}' http://0.0.0.0:8585/v1/resource_classes
|
||||
|
||||
update
|
||||
~~~~~~
|
||||
|
||||
To add or remove Racks on a ResourceClass, simply do an update and alter
|
||||
the racks array attribute accordingly.
|
||||
|
||||
::
|
||||
|
||||
curl -iX PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
|
||||
{
|
||||
"service_type": "compute",
|
||||
"name": "test-chassis",
|
||||
"racks":[
|
||||
{
|
||||
"id": 1,
|
||||
"links": [
|
||||
{
|
||||
"href":"http://0.0.0.0:8585/v1/racks/1",
|
||||
"rel":"self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/resource_classes/13``
|
||||
|
||||
delete
|
||||
~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -X DELETE http://0.0.0.0:8585/v1/resource_classes/1
|
||||
|
||||
`back to top <#index>`_
|
||||
|
||||
DataCenter
|
||||
----------
|
||||
|
||||
provision all
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
This will provision the data center according to its description in
|
||||
Tuskar.
|
||||
|
||||
::
|
||||
|
||||
curl -XPOST -H 'Content-Type:application/json' -H 'Accept: application/json' http://0.0.0.0:8585/v1/data_centers/
|
||||
|
||||
`back to top <#index>`_
|
||||
|
||||
Node
|
||||
----
|
||||
|
||||
Get Collection
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl http://0.0.0.0:8585/v1/nodes/
|
||||
|
||||
response
|
||||
^^^^^^^^
|
||||
|
||||
::
|
||||
|
||||
[
|
||||
{
|
||||
"nova_baremetal_node_id": "0e3ab3d3-bd85-40bd-b6a1-fae484040825",
|
||||
"id": "1",
|
||||
"links": [
|
||||
{
|
||||
"href": "http://127.0.0.1:8585/v1/nodes/1",
|
||||
"rel": "self"
|
||||
}
|
||||
],
|
||||
"rack": {
|
||||
"id": 1,
|
||||
"links":
|
||||
[
|
||||
{
|
||||
"href": "http://127.0.0.1:8585/v1/racks/1",
|
||||
"rel": "self"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Retrieve a single Node
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl http://0.0.0.0:8585/v1/nodes/1
|
||||
|
||||
response
|
||||
^^^^^^^^
|
||||
|
||||
::
|
||||
|
||||
{
|
||||
"nova_baremetal_node_id": "0e3ab3d3-bd85-40bd-b6a1-fae484040825",
|
||||
"id": "1",
|
||||
"links":
|
||||
[
|
||||
{
|
||||
"href": "http://127.0.0.1:8585/v1/nodes/1",
|
||||
"rel": "self"
|
||||
}
|
||||
],
|
||||
"rack":
|
||||
{
|
||||
"id": 1,
|
||||
"links":
|
||||
[
|
||||
{
|
||||
"href": "http://127.0.0.1:8585/v1/racks/1",
|
||||
"rel": "self"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Overcloud
|
||||
----------
|
||||
|
||||
get Keystone URL for an overcloud
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
curl -X GET -H 'Content-Type:application/json' -H 'Accept: application/json' http://0.0.0.0:8585/v1/overclouds/cloudname
|
||||
|
||||
response
|
||||
^^^^^^^^
|
||||
|
||||
::
|
||||
|
||||
{
|
||||
"stack_name": "cloudname",
|
||||
"links": [
|
||||
{
|
||||
"rel": "keystone",
|
||||
"href": "http://192.0.2.5:5000/v2.0/"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
`back to top <#index>`_
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 78 KiB |
Binary file not shown.
Before Width: | Height: | Size: 61 KiB |
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 93 KiB |
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 91 KiB |
Binary file not shown.
@ -1,35 +0,0 @@
|
||||
======================
|
||||
Debugging with iPython
|
||||
======================
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
::
|
||||
|
||||
$ yum install python-ipython
|
||||
$ cd tuskar
|
||||
$ find . | grep no-global-site-packages.txt | xargs rm
|
||||
|
||||
The 'find' will allow you to import 'global' packages in Tox.
|
||||
|
||||
Debugging
|
||||
---------
|
||||
|
||||
Place these two lines in the place you want to debug/drop to shell:
|
||||
|
||||
::
|
||||
|
||||
import IPython
|
||||
IPython.embed()
|
||||
|
||||
Then start Tuskar as usual and do a GET/POST/etc. Once the code
|
||||
execution hits these two lines, you will be dropped into the iPython shell
|
||||
and you will have access to all local variables and the env defined in the
|
||||
context of where you placed that two lines.
|
||||
|
||||
Tweaks
|
||||
------
|
||||
|
||||
`ipythonrc <https://github.com/queezythegreat/settings/tree/master/ipython>`_
|
||||
-> Colors on console, tab completion for methods and more ;-)
|
@ -1,166 +0,0 @@
|
||||
================
|
||||
Demo Data Script
|
||||
================
|
||||
|
||||
This document details the beginning of the walkthrough script for the Tuskar
|
||||
demo.
|
||||
|
||||
To use this, clear your database and run the commands below. The result
|
||||
should be a HEAT template with 6 compute Nodes and 1 non-compute Node.
|
||||
|
||||
N.B. The HEAT template does not define availability zones for the nodes.
|
||||
Therefore the nodes could be deployed onto any rack. This will be fixed
|
||||
in a subsequent patch.
|
||||
|
||||
**Note:** The commands below are useful for experimenting with different
|
||||
creation scenarios, but the exact data center described therein can also
|
||||
be created by running:
|
||||
|
||||
::
|
||||
|
||||
python tools/sample_data/py
|
||||
|
||||
from your development environment.
|
||||
|
||||
Create Racks
|
||||
------------
|
||||
|
||||
This command creates three Racks. Two Racks are assigned to the
|
||||
compute Resource Class and contain three Baremetal Nodes each. One Rack
|
||||
is designated to the non-compute Resource Class and contains 1 Baremetal
|
||||
Node only.
|
||||
|
||||
::
|
||||
|
||||
curl -vX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '
|
||||
{
|
||||
"subnet": "192.168.1.0/255",
|
||||
"name": "compute_1",
|
||||
"capacities": [{
|
||||
"name": "total_cpu",
|
||||
"value": "64"
|
||||
}, {
|
||||
"name": "total_memory",
|
||||
"value": "1024"
|
||||
}],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "nova_bare_metal_1"
|
||||
},
|
||||
{
|
||||
"id": "nova_bare_metal_2"
|
||||
},
|
||||
{
|
||||
"id": "nova_bare_metal_3"
|
||||
}
|
||||
],
|
||||
"slots": 3
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/racks
|
||||
|
||||
curl -vX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '
|
||||
{
|
||||
"subnet": "192.168.2.0/255",
|
||||
"name": "compute_2",
|
||||
"capacities": [{
|
||||
"name": "total_cpu",
|
||||
"value": "64"
|
||||
}, {
|
||||
"name": "total_memory",
|
||||
"value": "1024"
|
||||
}],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "nova_bare_metal_4"
|
||||
},
|
||||
{
|
||||
"id": "nova_bare_metal_5"
|
||||
},
|
||||
{
|
||||
"id": "nova_bare_metal_6"
|
||||
}
|
||||
],
|
||||
"slots": 3
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/racks
|
||||
|
||||
curl -vX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -v -d '
|
||||
{
|
||||
"subnet": "192.168.2.0/255",
|
||||
"name": "non_compute",
|
||||
"capacities": [{
|
||||
"name": "total_cpu",
|
||||
"value": "64"
|
||||
}, {
|
||||
"name": "total_memory",
|
||||
"value": "1024"
|
||||
}],
|
||||
"nodes": [
|
||||
{
|
||||
"id": "nova_bare_metal_7"
|
||||
}],
|
||||
"slots": 3
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/racks
|
||||
|
||||
Create Resource Classes
|
||||
-----------------------
|
||||
|
||||
This command creates two Resource Classes. The compute Resource Class contains two Racks
|
||||
and a total of six Nodes. The non-compute Resource Class contains one Rack and one Node.
|
||||
|
||||
::
|
||||
|
||||
curl -iX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
|
||||
{
|
||||
"name": "compute-rc",
|
||||
"service_type":"compute",
|
||||
"racks": [
|
||||
{
|
||||
"id":1,
|
||||
"links":[{"href":"http://0.0.0.0:8585/v1/racks/1","rel":"self"}]
|
||||
},
|
||||
{
|
||||
"id":2,
|
||||
"links":[{"href":"http://0.0.0.0:8585/v1/racks/2","rel":"self"}]
|
||||
}
|
||||
],
|
||||
"flavors": [
|
||||
{ "name" : "x-large",
|
||||
"capacities" : [
|
||||
{ "name": "cpu",
|
||||
"value" : "4",
|
||||
"unit" : "count" },
|
||||
{ "name": "memory",
|
||||
"value" : "8192",
|
||||
"unit" : "MiB" },
|
||||
{ "name": "storage",
|
||||
"value" : "1024",
|
||||
"unit" : "GiB" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/resource_classes
|
||||
|
||||
curl -iX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
|
||||
{
|
||||
"name": "non-compute-rc",
|
||||
"service_type":"not_compute",
|
||||
"racks": [
|
||||
{
|
||||
"id":3,
|
||||
"links":[{"href":"http://0.0.0.0:8585/v1/racks/3","rel":"self"}]
|
||||
}
|
||||
]
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/resource_classes
|
||||
|
||||
Generate HEAT Template
|
||||
----------------------
|
||||
|
||||
This command generates the HEAT template based on the Tuskar description.
|
||||
|
||||
::
|
||||
|
||||
curl http://0.0.0.0:8585/v1/data_centers
|
@ -48,8 +48,6 @@ Install and Contribute
|
||||
|
||||
INSTALL
|
||||
CONTRIBUTING
|
||||
debugging-with-ipython
|
||||
demo-data-script
|
||||
recommended-reading
|
||||
|
||||
API version 2
|
||||
@ -60,15 +58,6 @@ API version 2
|
||||
|
||||
api/curl-v2
|
||||
|
||||
API version 1
|
||||
-------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
api/curl
|
||||
resource-class-demo-script
|
||||
|
||||
HEAT Integration
|
||||
----------------
|
||||
|
||||
|
@ -1,94 +0,0 @@
|
||||
==========================
|
||||
Resource Class Demo Script
|
||||
==========================
|
||||
|
||||
Get a Resource Class
|
||||
--------------------
|
||||
|
||||
::
|
||||
|
||||
curl -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes/1
|
||||
|
||||
{
|
||||
"service_type": "compute",
|
||||
"racks": [],
|
||||
"id": 1,
|
||||
"links": [{
|
||||
"href": "http://0.0.0.0:8585/v1/resource_classes/1",
|
||||
"rel": "self"
|
||||
}],
|
||||
"name": "test-chassis"
|
||||
}
|
||||
|
||||
Get the Resource Class Collection
|
||||
---------------------------------
|
||||
|
||||
::
|
||||
|
||||
curl -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes/
|
||||
|
||||
Create a Resource Class with a Rack
|
||||
-----------------------------------
|
||||
|
||||
::
|
||||
|
||||
curl -iX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
|
||||
{
|
||||
"service_type": "compute",
|
||||
"name": "test-chassis",
|
||||
"racks":[
|
||||
{
|
||||
"id": 1,
|
||||
"links": [
|
||||
{
|
||||
"href":"http://0.0.0.0:8585/v1/racks/1",
|
||||
"rel":"self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/resource_classes``
|
||||
|
||||
Update the Racks on a Resource Class (Remove Racks)
|
||||
---------------------------------------------------
|
||||
|
||||
::
|
||||
|
||||
curl -iX PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
|
||||
{
|
||||
"service_type": "compute",
|
||||
"name": "test-chassis",
|
||||
"racks":[]
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/resource_classes/13``
|
||||
|
||||
Update the Racks on a Resource Class (Add a Rack)
|
||||
-------------------------------------------------
|
||||
|
||||
::
|
||||
|
||||
curl -iX PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
|
||||
{
|
||||
"service_type": "compute",
|
||||
"name": "test-chassis",
|
||||
"racks":[
|
||||
{
|
||||
"id": 2,
|
||||
"links": [
|
||||
{
|
||||
"href":"http://0.0.0.0:8585/v1/racks/2",
|
||||
"rel":"self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
' http://0.0.0.0:8585/v1/resource_classes/13``
|
||||
|
||||
Delete a Resource Class
|
||||
-----------------------
|
||||
|
||||
::
|
||||
|
||||
curl -iX DELETE -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes/13
|
Loading…
x
Reference in New Issue
Block a user