Rename instance to server and instance type to flavor

Change-Id: I35a7fb0b4f3fa9e09f2fc2c739c0a9b39a8576ab
changes/83/460383/10
liusheng 2017-04-26 14:34:59 +08:00
parent 49b26986f6
commit 7d0f8ab360
111 changed files with 2557 additions and 2572 deletions

View File

@ -6,9 +6,9 @@
Show and manage server flavors.
Flavors are a way to describe the basic dimensions of a instance to be
Flavors are a way to describe the basic dimensions of a server to be
created including how much ``cpu``, ``ram``, and ``disk space`` are
allocated to an instance built with this flavor.
allocated to a server built with this flavor.
List Flavors
============
@ -189,7 +189,7 @@ Delete Flavor
Deletes a flavor.
This is typically an admin only action. Deleting a flavor that is in use by
existing instances is not recommended as it can cause incorrect data to
existing servers is not recommended as it can cause incorrect data to
be returned to the user under some operations.
Normal response codes: 204

View File

@ -7,9 +7,9 @@ Baremetal Compute API V1 (CURRENT)
.. rest_expand_all::
.. include:: urls.inc
.. include:: instances.inc
.. include:: instance_states.inc
.. include:: instance_networks.inc
.. include:: servers.inc
.. include:: server_states.inc
.. include:: server_networks.inc
.. include:: flavors.inc
.. include:: flavor_access.inc
.. include:: availability_zones.inc

View File

@ -1,35 +0,0 @@
.. -*- rst -*-
========================
Instance Serial Console
========================
Instances Serial Console can be managed through serial_console sub-resource.
Instance Serial Console Summary
===============================
.. rest_method:: GET /v1/instances/{instance_uuid}/serial_console
Get the console url info of the Instance.
Normal response code: 200
Request
-------
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
Response
--------
.. rest_parameters:: parameters.yaml
- console: console_info
**Example instance network:**
.. literalinclude:: samples/instance_console/instance-serial-console-get.json

View File

@ -1,140 +0,0 @@
.. -*- rst -*-
=================
Instance States
=================
Instances States can be managed through states sub-resource.
A Instance can be rebooted, turned on, or turned off by requesting a change to
its power state.
Instance State Summary
======================
.. rest_method:: GET /v1/instances/{instance_uuid}/states
Get a summary of the Instance's current states.
Normal response code: 200
Request
-------
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
Response
--------
.. rest_parameters:: parameters.yaml
- power_state: power_state
- locked: lock_state
- status: instance_status
**Example instance state:**
.. literalinclude:: samples/instance_states/instance-get-state-response.json
Change Instance Power State
===========================
.. rest_method:: PUT /v1/instances/{instance_uuid}/states/power
Request a change to the Instance's power state.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (InvalidState)
- 406 (NotAcceptable)
Request
-------
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
- target: power_state_target
**Example request to power off a Instance:**
.. literalinclude:: samples/instance_states/instance-set-power-off.json
Response
--------
If successful, this method does not return content in the response body.
Change Instance Lock State
===========================
.. rest_method:: PUT /v1/instances/{instance_uuid}/states/lock
Request a change to the Instance's lockstate.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (BadRequest)
- 403 (Forbidden)
Request
-------
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
- target: lock_state
**Example request to lock an Instance:**
.. literalinclude:: samples/instance_states/lock-instance.json
**Example request to unlock an Instance:**
.. literalinclude:: samples/instance_states/unlock-instance.json
Response
--------
If successful, this method does not return content in the response body.
Change Instance Provision State
===============================
.. rest_method:: PUT /v1/instances/{instance_uuid}/states/provision
Request a change to the Instance's provision state.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (BadRequest)
- 403 (Forbidden)
Request
-------
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
- target: provision_state
**Example request to rebuild an Instance:**
.. literalinclude:: samples/instance_states/rebuild-instance.json
Response
--------
If successful, this method does not return content in the response body.

View File

@ -27,9 +27,9 @@ flavor_uuid_path:
in: path
required: true
type: string
instance_ident:
server_ident:
description: |
The UUID of the instance.
The UUID of the server.
in: path
required: true
type: string
@ -49,7 +49,7 @@ tenant_id_path:
# variables in query
all_tenants:
description: |
Specify the ``all_tenants=1`` query parameter to list all instances
Specify the ``all_tenants=1`` query parameter to list all servers
for all projects. By default this is only allowed by admin users.
in: query
required: false
@ -59,11 +59,11 @@ fields:
One or more fields to be returned in the response.
For example, the following request returns only the ``uuid``
and ``name`` fields for each instance:
and ``name`` fields for each server:
::
GET /v1/instances?fields=uuid,name
GET /v1/servers?fields=uuid,name
in: query
required: false
type: array
@ -84,11 +84,11 @@ address:
type: string
availability_zone:
description: |
The availability zone from which to launch the instance. When you provision resources,
you specify from which availability zone you want your instance to be built. Typically,
The availability zone from which to launch the server. When you provision resources,
you specify from which availability zone you want your server to be built. Typically,
you use availability zones to arrange bare metal nodes into logical groups.
An availability zone provides a form of physical isolation and redundancy from
other availability zones. For instance, if some racks in your data center are
other availability zones. For server, if some racks in your data center are
on a separate power source, you can put servers in those racks in their own availability
zone. Availability zones can also help separate different classes of hardware. By
segregating resources into availability zones, you can ensure that your application
@ -183,7 +183,7 @@ flavor_uuid_not_required:
type: string
flavorRef:
description: |
The flavor reference, as a UUID for the flavor for your server instance.
The flavor reference, as a UUID for the flavor for your server server.
in: body
required: true
type: string
@ -195,39 +195,7 @@ flavors:
type: array
imageRef:
description: |
The UUID of the image to use for your instance.
in: body
required: true
type: string
instance_description:
description: |
A free form description of the instance. Limited to 255 characters
in length.
in: body
required: false
type: string
instance_name:
description: |
The instance name.
in: body
required: true
type: string
instance_power_state:
description: |
The current power state of this instance. Usually, “power on” or “power off”, but may be “None”
if Mogan is unable to determine the power state (eg, due to hardware failure)
in: body
required: true
type: string
instance_status:
description: |
The status of this instance. Usually, "building", "active", "error", or "None".
in: body
required: true
type: string
instance_uuid:
description: |
The UUID of the instance
The UUID of the image to use for your server.
in: body
required: true
type: string
@ -304,7 +272,7 @@ keypairs:
Array of Keypair objects
launched_at:
description: |
The date and time when the instance was launched. The date and time
The date and time when the server was launched. The date and time
stamp format is `ISO 8601 <https://en.wikipedia.org/wiki/ISO_8601>`_
::
@ -325,23 +293,23 @@ links:
type: array
lock_state:
description: |
The request to lock/unlock instances.
The request to lock/unlock servers.
in: body
required: true
type: boolean
max_count_body:
description: |
The max number of instances to be created. Defaults to the value of ``min_count``.
The max number of servers to be created. Defaults to the value of ``min_count``.
in: body
required: false
type: integer
min_count_body:
description: |
The min number of instances to be created. Defaults to 1.
The min number of servers to be created. Defaults to 1.
in: body
required: false
type: integer
multi_instacne_name_body:
multi_server_name_body:
description: |
A base name for creating unique names during multiple create. A unique
string will be appended to the end of this base name for every instacne
@ -351,30 +319,30 @@ multi_instacne_name_body:
type: string
network_info:
description: |
The port info in the requested network for the instance, with fixed_ip, mac_address, and
The port info in the requested network for the server, with fixed_ip, mac_address, and
network uuid
in: body
required: true
type: dict
network_port_type:
description: |
To provision the server instance with a specified type of NIC(like 1GE or 10 GE) for a
To provision the server server with a specified type of NIC(like 1GE or 10 GE) for a
network, specify the type of the NIC in the ``port_type`` key in a dict in ``networks`` list.
in: body
required: false
type: string
network_uuid:
description: |
To provision the server instance with a NIC for a network, specify the UUID of
To provision the server server with a NIC for a network, specify the UUID of
the network in the ``uuid`` key in a dict in ``networks`` list.
in: body
required: true
type: string
networks:
description: |
A list of networks of the tenant. Optionally, you can create one or more NICs on the instance.
To provision the server instance with a NIC for a network, specify the UUID of the network
in the ``uuid`` key in a dict in ``networks`` list. To provision the server instance with a
A list of networks of the tenant. Optionally, you can create one or more NICs on the server.
To provision the server server with a NIC for a network, specify the UUID of the network
in the ``uuid`` key in a dict in ``networks`` list. To provision the server server with a
specified type of NIC, specify the port-type key in a dict in a ``networks`` list.
in: body
required: true
@ -389,7 +357,7 @@ personality:
type: string
power_state:
description: |
The current power state of this Instance. Usually, "power on" or
The current power state of this Server. Usually, "power on" or
"power off", but may be "None" if Mogan is unable to determine the power
state (eg, due to hardware failure).
in: body
@ -414,6 +382,38 @@ provision_state:
in: body
required: true
type: string
server_description:
description: |
A free form description of the server. Limited to 255 characters
in length.
in: body
required: false
type: string
server_name:
description: |
The server name.
in: body
required: true
type: string
server_power_state:
description: |
The current power state of this server. Usually, “power on” or “power off”, but may be “None”
if Mogan is unable to determine the power state (eg, due to hardware failure)
in: body
required: true
type: string
server_status:
description: |
The status of this server. Usually, "building", "active", "error", or "None".
in: body
required: true
type: string
server_uuid:
description: |
The UUID of the server
in: body
required: true
type: string
tenant_id_body:
description: |
The UUID of the tenant in a multi-tenancy cloud.
@ -443,7 +443,7 @@ user_data:
type: string
user_id_body:
description: |
The user ID of the user who owns the instance.
The user ID of the user who owns the server.
in: body
required: true
type: string

View File

@ -1,7 +1,7 @@
{
"name": "test_instance",
"description": "this is a test instance",
"instance_type_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"name": "test_server",
"description": "this is a test server",
"flavor_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"image_uuid": "efe0a06f-ca95-4808-b41e-9f55b9c5eb98",
"networks": [
{

View File

@ -1,7 +1,7 @@
{
"name": "test_instance",
"description": "this is a test instance",
"instance_type_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"name": "test_server",
"description": "this is a test server",
"flavor_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"image_uuid": "efe0a06f-ca95-4808-b41e-9f55b9c5eb98",
"availability_zone": "mogan",
"networks": [

View File

@ -1,18 +1,18 @@
{
"name": "test_instance",
"description": "this is a test instance",
"instance_type_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"name": "test_server",
"description": "this is a test server",
"flavor_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"image_uuid": "efe0a06f-ca95-4808-b41e-9f55b9c5eb98",
"availability_zone" : "Beijing-01",
"status": "active",
"power_state": "on",
"links": [
{
"href": "http://10.3.150.17:6688/v1/instances/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"href": "http://10.3.150.17:6688/v1/servers/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/instances/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"href": "http://10.3.150.17:6688/servers/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],

View File

@ -1,20 +1,20 @@
{
"availability_zone": null,
"created_at": "2016-10-17T04:12:41+00:00",
"description": "this is a test instance",
"description": "this is a test server",
"image_uuid": "ac3b2291-b9ef-45f6-8eeb-21ac568a64a5",
"instance_type_uuid": "28708dff-283c-449e-9bfa-a48c93480c86",
"flavor_uuid": "28708dff-283c-449e-9bfa-a48c93480c86",
"links": [
{
"href": "http://localhost:6688/v1/instances/f978ef48-d4af-4dad-beec-e6174309bc71",
"href": "http://localhost:6688/v1/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "self"
},
{
"href": "http://localhost:6688/instances/f978ef48-d4af-4dad-beec-e6174309bc71",
"href": "http://localhost:6688/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "bookmark"
}
],
"name": "test_instance",
"name": "test_server",
"network_info": {
"12cffc4a-b845-409e-b589-7c84be4b10d9": {
"fixed_ips": [

View File

@ -1,22 +1,22 @@
{
"instances": [
"servers": [
{
"availability_zone": null,
"created_at": "2016-10-17T04:12:41+00:00",
"description": "this is a test instance",
"description": "this is a test server",
"image_uuid": "ac3b2291-b9ef-45f6-8eeb-21ac568a64a5",
"instance_type_uuid": "28708dff-283c-449e-9bfa-a48c93480c86",
"flavor_uuid": "28708dff-283c-449e-9bfa-a48c93480c86",
"links": [
{
"href": "http://localhost:6688/v1/instances/f978ef48-d4af-4dad-beec-e6174309bc71",
"href": "http://localhost:6688/v1/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "self"
},
{
"href": "http://localhost:6688/instances/f978ef48-d4af-4dad-beec-e6174309bc71",
"href": "http://localhost:6688/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "bookmark"
}
],
"name": "test_instance",
"name": "test_server",
"network_info": {
"12cffc4a-b845-409e-b589-7c84be4b10d9": {
"fixed_ips": [

View File

@ -1,18 +1,18 @@
{
"instances": [
"servers": [
{
"description": "this is a test instance",
"description": "this is a test server",
"links": [
{
"href": "http://localhost:6688/v1/instances/f978ef48-d4af-4dad-beec-e6174309bc71",
"href": "http://localhost:6688/v1/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "self"
},
{
"href": "http://localhost:6688/instances/f978ef48-d4af-4dad-beec-e6174309bc71",
"href": "http://localhost:6688/servers/f978ef48-d4af-4dad-beec-e6174309bc71",
"rel": "bookmark"
}
],
"name": "test_instance",
"name": "test_server",
"status": "building",
"power_state": "power on",
"uuid": "f978ef48-d4af-4dad-beec-e6174309bc71"

View File

@ -1,18 +1,18 @@
{
"name": "test_instance",
"description": "this is a test instance",
"instance_type_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"name": "test_server",
"description": "this is a test server",
"flavor_uuid": "0607b5f3-6111-424d-ba46-f5de39a6fa69",
"image_uuid": "efe0a06f-ca95-4808-b41e-9f55b9c5eb98",
"availability_zone": "Beijing-01",
"status": "active",
"power_state": "on",
"links": [
{
"href": "http://10.3.150.17:6688/v1/instances/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"href": "http://10.3.150.17:6688/v1/servers/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "self"
},
{
"href": "http://10.3.150.17:6688/instances/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"href": "http://10.3.150.17:6688/servers/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
"rel": "bookmark"
}
],

View File

@ -1,21 +1,21 @@
.. -*- rst -*-
===================
Instance Networks
Server Networks
===================
Instances Networks can be managed through networks sub-resource.
Servers Networks can be managed through networks sub-resource.
A Instance can be associated or dissociated with a floating IP by requesting
A Server can be associated or dissociated with a floating IP by requesting
the floatingip sub-resource.
Instance Network Summary
Server Network Summary
========================
.. rest_method:: GET /v1/instances/{instance_uuid}/networks
.. rest_method:: GET /v1/servers/{server_uuid}/networks
Get a summary of the Instance's networks.
Get a summary of the Server's networks.
Normal response code: 200
@ -24,7 +24,7 @@ Request
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
- server_uuid: server_ident
Response
--------
@ -33,20 +33,20 @@ Response
- ports: network_info
**Example instance network:**
**Example server network:**
.. literalinclude:: samples/instance_networks/instance-get-network-response.json
.. literalinclude:: samples/server_networks/server-get-network-response.json
Add (Associate) Floating IP
===========================
.. rest_method:: POST /v1/instances/{instance_uuid}/networks/floatingips
.. rest_method:: POST /v1/servers/{server_uuid}/networks/floatingips
Adds a floating IP address to an instance, which associates
that address with the instance.
Adds a floating IP address to a server, which associates
that address with the server.
If an instance is connected to multiple networks, you can associate a
If a server is connected to multiple networks, you can associate a
floating IP address with a specific fixed IP address by using the
optional ``fixed_address`` parameter.
@ -59,13 +59,13 @@ Request
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
- server_uuid: server_ident
- address: address
- fixed_address: fixed_address
**Example request to Add (Associate) Floating IP to an instance:**
**Example request to Add (Associate) Floating IP to a server:**
.. literalinclude:: samples/instance_networks/instance-associate-fip-req.json
.. literalinclude:: samples/server_networks/server-associate-fip-req.json
Response
--------
@ -76,9 +76,9 @@ If successful, this method does not return content in the response body.
Remove (Disassociate) Floating IP
=================================
.. rest_method:: DELETE /v1/instances/{instance_uuid}/networks/floatingips/{fip_address}
.. rest_method:: DELETE /v1/servers/{server_uuid}/networks/floatingips/{fip_address}
Removes, or disassociates, a floating IP address from an instance.
Removes, or disassociates, a floating IP address from a server.
Normal response codes: 204
@ -90,7 +90,7 @@ Request
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
- server_uuid: server_ident
- fip_address: address_path
Response

View File

@ -0,0 +1,35 @@
.. -*- rst -*-
========================
Server Serial Console
========================
Servers Serial Console can be managed through serial_console sub-resource.
Server Serial Console Summary
===============================
.. rest_method:: GET /v1/servers/{server_uuid}/serial_console
Get the console url info of the Server.
Normal response code: 200
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
Response
--------
.. rest_parameters:: parameters.yaml
- console: console_info
**Example server network:**
.. literalinclude:: samples/server_console/server-serial-console-get.json

View File

@ -0,0 +1,140 @@
.. -*- rst -*-
=================
Server States
=================
Servers States can be managed through states sub-resource.
A Server can be rebooted, turned on, or turned off by requesting a change to
its power state.
Server State Summary
======================
.. rest_method:: GET /v1/servers/{server_uuid}/states
Get a summary of the Server's current states.
Normal response code: 200
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
Response
--------
.. rest_parameters:: parameters.yaml
- power_state: power_state
- locked: lock_state
- status: server_status
**Example server state:**
.. literalinclude:: samples/server_states/server-get-state-response.json
Change Server Power State
===========================
.. rest_method:: PUT /v1/servers/{server_uuid}/states/power
Request a change to the Server's power state.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (InvalidState)
- 406 (NotAcceptable)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- target: power_state_target
**Example request to power off a Server:**
.. literalinclude:: samples/server_states/server-set-power-off.json
Response
--------
If successful, this method does not return content in the response body.
Change Server Lock State
===========================
.. rest_method:: PUT /v1/servers/{server_uuid}/states/lock
Request a change to the Server's lockstate.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (BadRequest)
- 403 (Forbidden)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- target: lock_state
**Example request to lock a Server:**
.. literalinclude:: samples/server_states/lock-server.json
**Example request to unlock a Server:**
.. literalinclude:: samples/server_states/unlock-server.json
Response
--------
If successful, this method does not return content in the response body.
Change Server Provision State
===============================
.. rest_method:: PUT /v1/servers/{server_uuid}/states/provision
Request a change to the Server's provision state.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (BadRequest)
- 403 (Forbidden)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- target: provision_state
**Example request to rebuild a Server:**
.. literalinclude:: samples/server_states/rebuild-server.json
Response
--------
If successful, this method does not return content in the response body.

View File

@ -1,24 +1,24 @@
.. -*- rst -*-
===========
Instances
Servers
===========
Lists, creates, shows details for, updates, and deletes instances.
Lists, creates, shows details for, updates, and deletes servers.
Create Instance
Create Server
===============
.. rest_method:: POST /instances
.. rest_method:: POST /servers
Creates an instance.
Creates a server.
The progress of this operation depends on the location of the
requested image, network I/O, selected type, and other factors.
The ``Location`` header returns the full URL to the newly created
instance and is available as a ``self`` and ``bookmark`` link in the
instance representation.
server and is available as a ``self`` and ``bookmark`` link in the
server representation.
Normal response codes: 201
@ -30,9 +30,9 @@ Request
.. rest_parameters:: parameters.yaml
- name: instance_name
- description: instance_description
- instance_type_uuid: flavorRef
- name: server_name
- description: server_description
- flavor_uuid: flavorRef
- image_uuid: imageRef
- availability_zone: availability_zone
- networks: networks
@ -42,9 +42,9 @@ Request
- personality: personality
- key_name: key_name
**Example Create Instance: JSON request**
**Example Create Server: JSON request**
.. literalinclude:: samples/instances/instance-create-req.json
.. literalinclude:: samples/servers/server-create-req.json
:language: javascript
Response
@ -52,40 +52,40 @@ Response
.. rest_parameters:: parameters.yaml
- name: instance_name
- description: instance_description
- instance_type_uuid: flavorRef
- name: server_name
- description: server_description
- flavor_uuid: flavorRef
- image_uuid: imageRef
- availability_zone: availability_zone
- network_info: network_info
- links: links
- uuid: instance_uuid
- status: instance_status
- power_state: instance_power_state
- uuid: server_uuid
- status: server_status
- power_state: server_power_state
- project_id: project_id_body
- user_id: user_id_body
- updated_at: updated_at
- created_at: created_at
- extra: extra
**Example Create Instance: JSON response**
**Example Create Server: JSON response**
.. literalinclude:: samples/instances/instance-create-resp.json
.. literalinclude:: samples/servers/server-create-resp.json
:language: javascript
Create Multiple Instances
Create Multiple Servers
=========================
.. rest_method:: POST /instances
.. rest_method:: POST /servers
Create Multiple Instances.
Create Multiple Servers.
There is a second kind of create call which can create multiple instances
There is a second kind of create call which can create multiple servers
at once. This supports all the same parameters as create with a few additional
attributes specific to multiple create.
Error handling for multiple create is not as consistent as for single instance
create, and there is no guarantee that all the instances will be created
Error handling for multiple create is not as consistent as for single server
create, and there is no guarantee that all the servers will be created
successfully.
Normal response codes: 201
@ -100,37 +100,37 @@ These are the parameters beyond single create that are supported.
.. rest_parameters:: parameters.yaml
- name: multi_instacne_name_body
- name: multi_server_name_body
- min_count: min_count_body
- max_count: max_count_body
**Example Create Multiple Instance: JSON request**
**Example Create Multiple Server: JSON request**
.. literalinclude:: samples/instances/multi-instance-create-req.json
.. literalinclude:: samples/servers/multi-server-create-req.json
:language: javascript
Response
--------
The first instance will be returned. The returned paramaters is same to creating
a single instance's.
The first server will be returned. The returned paramaters is same to creating
a single server's.
**Example Create Multiple Instance: JSON response**
**Example Create Multiple Server: JSON response**
.. literalinclude:: samples/instances/instance-create-resp.json
.. literalinclude:: samples/servers/server-create-resp.json
:language: javascript
List Instances
List Servers
===============
.. rest_method:: GET /instances
.. rest_method:: GET /servers
Return a list of bare metal Instances, with some useful information about each
Instance.
Return a list of bare metal Servers, with some useful information about each
Server.
By default, this query will return the name, instance uuid, instance status
and description for each Instance.
By default, this query will return the name, server uuid, server status
and description for each Server.
Normal response codes: 200
@ -150,25 +150,25 @@ Response
.. rest_parameters:: parameters.yaml
- name: instance_name
- description: instance_description
- uuid: instance_uuid
- status: instance_status
- power_state: instance_power_state
- name: server_name
- description: server_description
- uuid: server_uuid
- status: server_status
- power_state: server_power_state
- links: links
**Example List of Instances: JSON response**
**Example List of Servers: JSON response**
.. literalinclude:: samples/instances/instance-list-resp.json
.. literalinclude:: samples/servers/server-list-resp.json
:language: javascript
List Instances Detailed
List Servers Detailed
=======================
.. rest_method:: GET /instances/detail
.. rest_method:: GET /servers/detail
Return a list of bare metal Instances with complete details.
Return a list of bare metal Servers with complete details.
Normal response codes: 200
@ -185,16 +185,16 @@ Response
.. rest_parameters:: parameters.yaml
- name: instance_name
- description: instance_description
- instance_type_uuid: flavorRef
- name: server_name
- description: server_description
- flavor_uuid: flavorRef
- image_uuid: imageRef
- availability_zone: availability_zone
- network_info: network_info
- links: links
- uuid: instance_uuid
- status: instance_status
- power_state: instance_power_state
- uuid: server_uuid
- status: server_status
- power_state: server_power_state
- project_id: project_id_body
- user_id: user_id_body
- updated_at: updated_at
@ -202,18 +202,18 @@ Response
- launched_at: launched_at
- extra: extra
**Example Detailed list of Instances: JSON response**
**Example Detailed list of Servers: JSON response**
.. literalinclude:: samples/instances/instance-list-detail-resp.json
.. literalinclude:: samples/servers/server-list-detail-resp.json
:language: javascript
Show Instance Details
Show Server Details
=====================
.. rest_method:: GET /instances/{instance_uuid}
.. rest_method:: GET /servers/{server_uuid}
Shows details of an instance. By default, this will return the full
Shows details of a server. By default, this will return the full
representation of the resource; an optional fields parameter can be supplied to
return only the specified set.
@ -227,7 +227,7 @@ Request
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
- server_uuid: server_ident
- fields: fields
Response
@ -235,16 +235,16 @@ Response
.. rest_parameters:: parameters.yaml
- name: instance_name
- description: instance_description
- instance_type_uuid: flavorRef
- name: server_name
- description: server_description
- flavor_uuid: flavorRef
- image_uuid: imageRef
- availability_zone: availability_zone
- network_info: network_info
- links: links
- uuid: instance_uuid
- status: instance_status
- power_state: instance_power_state
- uuid: server_uuid
- status: server_status
- power_state: server_power_state
- project_id: project_id_body
- user_id: user_id_body
- updated_at: updated_at
@ -252,18 +252,18 @@ Response
- launched_at: launched_at
- extra: extra
**Example Instance Details: JSON response**
**Example Server Details: JSON response**
.. literalinclude:: samples/instances/instance-detail-resp.json
.. literalinclude:: samples/servers/server-detail-resp.json
:language: javascript
Update Instance
Update Server
===============
.. rest_method:: PATCH /instances/{instance_uuid}
.. rest_method:: PATCH /servers/{server_uuid}
Updates the infromation stored about an instance.
Updates the infromation stored about a server.
Normal response codes: 200
@ -278,11 +278,11 @@ The BODY of the PATCH request must be a JSON PATCH document, adhering to
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
- server_uuid: server_ident
**Example Update Instance: JSON request**
**Example Update Server: JSON request**
.. literalinclude:: samples/instances/instance-update-req.json
.. literalinclude:: samples/servers/server-update-req.json
:language: javascript
Response
@ -290,38 +290,38 @@ Response
.. rest_parameters:: parameters.yaml
- name: instance_name
- description: instance_description
- instance_type_uuid: flavorRef
- name: server_name
- description: server_description
- flavor_uuid: flavorRef
- image_uuid: imageRef
- availability_zone: availability_zone
- network_info: network_info
- links: links
- uuid: instance_uuid
- status: instance_status
- power_state: instance_power_state
- uuid: server_uuid
- status: server_status
- power_state: server_power_state
- project_id: project_id_body
- user_id: user_id_body
- updated_at: updated_at
- created_at: created_at
- extra: extra
**Example Update Instance: JSON response**
**Example Update Server: JSON response**
.. literalinclude:: samples/instances/instance-update-resp.json
.. literalinclude:: samples/servers/server-update-resp.json
:language: javascript
Delete Instance
Delete Server
===============
.. rest_method:: DELETE /instances/{instance_uuid}
.. rest_method:: DELETE /servers/{server_uuid}
Deletes an instance.
Deletes a server.
Preconditions
- The instance must exist.
- The server must exist.
Normal response codes: 204
@ -332,7 +332,7 @@ Request
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
- server_uuid: server_ident
Response
--------

View File

@ -12,7 +12,7 @@ will be added to build a full path.
For instance, if the ``service url`` is
``http://mycompute.pvt/mogan/v1`` then the full API call for
``/instances`` is ``http://mycompute.pvt/mogan/v1/instances``.
``/servers`` is ``http://mycompute.pvt/mogan/v1/servers``.
Depending on the deployment the baremetal compute service url might
be http or https, a custom port, a custom path, and include your
@ -23,5 +23,5 @@ to work at a single site. It should always be discovered from the
Identity token.
As such, for the rest of this document we will be using short hand
where ``GET /instances`` really means ``GET
{your_service_url}/instances``.
where ``GET /servers`` really means ``GET
{your_service_url}/servers``.

View File

@ -193,7 +193,7 @@ if is_service_enabled mogan; then
echo_summary "Initializing mogan"
init_mogan
start_mogan
echo_summary "Creating instance type"
echo_summary "Creating flavor"
create_flavor
echo_summary "Updating ironic node properties"
update_ironic_node_type

View File

@ -1,11 +1,11 @@
{
"event_type": "instance.create.start",
"event_type": "server.create.start",
"payload": {
"mogan_object.name": "InstanceActionPayload",
"mogan_object.name": "ServerActionPayload",
"mogan_object.namespace": "mogan",
"mogan_object.version": "1.0",
"mogan_object.data": {
"instance_type_uuid": "6ce9904f-c61f-4ee8-afbe-c852c05258f6",
"flavor_uuid": "6ce9904f-c61f-4ee8-afbe-c852c05258f6",
"status": "building",
"user_id": "dfc14a6e939646d1929362de1758d7b2",
"uuid": "e1a7b5b7-c76c-4459-8328-10deda95819f",

View File

@ -350,14 +350,14 @@ Run stack.sh::
./stack.sh
Source credentials, and spawn an instance as the ``demo`` user::
Source credentials, and spawn a server as the ``demo`` user::
source ~/devstack/openrc
# query the image id of the default cirros image
image=$(openstack image show $DEFAULT_IMAGE_NAME -f value -c id)
# spawn instance
# spawn server
As our moganclient is not ready now, will add this soon...
Building developer documentation

View File

@ -27,8 +27,8 @@ from mogan.api.controllers import base
from mogan.api.controllers import link
from mogan.api.controllers.v1 import availability_zone
from mogan.api.controllers.v1 import flavors
from mogan.api.controllers.v1 import instances
from mogan.api.controllers.v1 import keypairs
from mogan.api.controllers.v1 import servers
from mogan.api import expose
@ -38,11 +38,11 @@ class V1(base.APIBase):
id = wtypes.text
"""The ID of the version, also acts as the release number"""
instances = [link.Link]
"""Links to the instances resource"""
servers = [link.Link]
"""Links to the servers resource"""
flavors = [link.Link]
"""Links to the instance types resource"""
"""Links to the server types resource"""
availability_zones = [link.Link]
"""Links to the availability zones resource"""
@ -54,13 +54,13 @@ class V1(base.APIBase):
def convert():
v1 = V1()
v1.id = "v1"
v1.instances = [link.Link.make_link('self', pecan.request.public_url,
'instances', ''),
link.Link.make_link('bookmark',
pecan.request.public_url,