Kongming API

Kongming API

Instance CPU Mappings

Show and manage server flavors.

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 a server built with this flavor.

GET
/servers

List Flavors

Lists all flavors accessible to your project.

Normal response codes: 200

Error response codes: unauthorized(401), forbidden(403)

Response

Name In Type Description
flavors body array An array of flavor objects.
name body string The name of the flavor.
links body array A list of relative links. Includes the self and bookmark links.
description body string The description of the flavor.
resources body object A dict of key and value pairs associate with the flavor including the resource name and the quantity.
resource_aggregates body object A dict of key and value pairs associate with the flavor including the resources aggregate metadata.
uuid body string The UUID of the flavor.
created_at body string

The date and time when the resource was created. The date and time stamp format is ISO 8601

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is -05:00.

updated_at body string

The date and time when the resource was updated. The date and time stamp format is ISO 8601

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is -05:00.

is_public body boolean Whether the flavor is public (available to all projects) or scoped to a set of projects. Default is True if not specified.
disabled (Optional) body boolean Whether or not the flavor has been administratively disabled.

Example List flavors

{
    "flavors": [
        {
            "description": "this is a test flavor1",
            "links": [
                {
                    "href": "http://10.3.150.17:6688/v1/flavors/2ce3df6b-f571-42e8-b6a8-8f7fa1c019ce",
                    "rel": "self"
                },
                {
                    "href": "http://10.3.150.17:6688/flavors/2ce3df6b-f571-42e8-b6a8-8f7fa1c019ce",
                    "rel": "bookmark"
                }
            ],
            "resources": {
                "CUSTOM_BAREMETAL_GOLD": 1
            },
            "resource_aggregates": {
                "high_mem": "true"
            },
            "created_at": "2016-09-22T03:21:57+00:00",
            "uuid": "2ce3df6b-f571-42e8-b6a8-8f7fa1c019ce",
            "updated_at": null,
            "is_public": true,
            "disabled": false,
            "name": "new_test1"
        },
        {
            "description": "this is a test flavor2",
            "links": [
                {
                    "href": "http://10.3.150.17:6688/v1/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
                    "rel": "self"
                },
                {
                    "href": "http://10.3.150.17:6688/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
                    "rel": "bookmark"
                }
            ],
            "resources": {
                "CUSTOM_BAREMETAL_GOLD": 1
            },
            "resource_aggregates": {
                "high_mem": "true"
            },
            "created_at": "2016-09-27T02:37:21+00:00",
            "uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
            "updated_at": null,
            "is_public": true,
            "disabled": false,
            "name": "new_test2"
        }
    ]
}
POST
/flavors

Create Flavor

Creates a flavor.

Creating a flavor is typically only available to administrators of a cloud because this has implications for scheduling efficiently in the cloud.

Normal response codes: 201

Error response codes: badRequest(400), unauthorized(401), forbidden(403), conflict(409)

Request

Name In Type Description
name body string The name of the flavor.
description body string The description of the flavor.
resources body object A dict of key and value pairs associate with the flavor including the resource name and the quantity.
resource_aggregates body object A dict of key and value pairs associate with the flavor including the resources aggregate metadata.
is_public (Optional) body boolean Whether the flavor is public (available to all projects) or scoped to a set of projects. Default is True if not specified.
disabled (Optional) body boolean Whether or not the flavor has been administratively disabled.

Example Create Flavor

{
    "name": "test_flavor",
    "description": "this is a test flavor",
    "resources": {
        "CUSTOM_BAREMETAL_GOLD": 1
    },
    "resource_aggregates": {
        "high_mem": "true"
    },
    "is_public": true,
    "disabled": true
}

Response

Name In Type Description
name body string The name of the flavor.
links body array A list of relative links. Includes the self and bookmark links.
description body string The description of the flavor.
resources body object A dict of key and value pairs associate with the flavor including the resource name and the quantity.
resource_aggregates body object A dict of key and value pairs associate with the flavor including the resources aggregate metadata.
uuid body string The UUID of the flavor.
created_at body string

The date and time when the resource was created. The date and time stamp format is ISO 8601

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is -05:00.

updated_at body string

The date and time when the resource was updated. The date and time stamp format is ISO 8601

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is -05:00.

is_public body boolean Whether the flavor is public (available to all projects) or scoped to a set of projects. Default is True if not specified.
disabled (Optional) body boolean Whether or not the flavor has been administratively disabled.

Example Create flavor

{
    "description": "this is a test flavor",
    "links": [
        {
            "href": "http://10.3.150.17:6688/v1/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
            "rel": "self"
        },
        {
            "href": "http://10.3.150.17:6688/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
            "rel": "bookmark"
        }
    ],
    "resources": {
        "CUSTOM_BAREMETAL_GOLD": 1
    },
    "resource_aggregates": {
        "high_mem": "true"
    },
    "created_at": "2016-09-27T02:37:21.966342+00:00",
    "uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
    "updated_at": null,
    "is_public": true,
    "disabled": true,
    "name": "test_flavor"
}
PATCH
/flavors/{flavor_uuid}

Update Flavor

Updates a flavor.

Updating a flavor is typically only available to administrators of a cloud because this has implications for scheduling efficiently in the cloud.

Normal response codes: 200

Error response codes: badRequest(400), unauthorized(401), forbidden(403), conflict(409)

Request

The BODY of the PATCH request must be a JSON PATCH document, adhering to RFC 6902.

Name In Type Description
flavor_uuid path string The UUID of the flavor.

Example Update Flavor: JSON request

[
    {
        "op": "replace",
        "path": "/name",
        "value": "updated_flavor"
    },
    {
        "op": "replace",
        "path": "/is_public",
        "value": false
    }
]

Response

Name In Type Description
name body string The name of the flavor.
links body array A list of relative links. Includes the self and bookmark links.
description body string The description of the flavor.
resources body object A dict of key and value pairs associate with the flavor including the resource name and the quantity.
resource_aggregates body object A dict of key and value pairs associate with the flavor including the resources aggregate metadata.
uuid body string The UUID of the flavor.
created_at body string

The date and time when the resource was created. The date and time stamp format is ISO 8601

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is -05:00.

updated_at body string

The date and time when the resource was updated. The date and time stamp format is ISO 8601

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is -05:00.

is_public body boolean Whether the flavor is public (available to all projects) or scoped to a set of projects. Default is True if not specified.
disabled (Optional) body boolean Whether or not the flavor has been administratively disabled.

Example Update flavor

{
    "description": "this is a flavor to be updated",
    "links": [
        {
            "href": "http://10.3.150.17:6688/v1/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
            "rel": "self"
        },
        {
            "href": "http://10.3.150.17:6688/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
            "rel": "bookmark"
        }
    ],
    "resources": {
        "CUSTOM_BAREMETAL_GOLD": 1
    },
    "resource_aggregates": {
        "high_mem": "true"
    },
    "created_at": "2016-09-27T02:37:21.966342+00:00",
    "uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
    "updated_at": null,
    "is_public": false,
    "disabled": false,
    "name": "updated_flavor"
}
GET
/flavors/{flavor_uuid}

Show Server Flavor Details

Shows details for a flavor.

Normal response codes: 200

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)

Request

Name In Type Description
flavor_uuid path string The UUID of the flavor.

Response

Name In Type Description
name body string The name of the flavor.
links body array A list of relative links. Includes the self and bookmark links.
description body string The description of the flavor.
resources body object A dict of key and value pairs associate with the flavor including the resource name and the quantity.
resource_aggregates body object A dict of key and value pairs associate with the flavor including the resources aggregate metadata.
uuid body string The UUID of the flavor.
created_at body string

The date and time when the resource was created. The date and time stamp format is ISO 8601

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is -05:00.

updated_at body string

The date and time when the resource was updated. The date and time stamp format is ISO 8601

CCYY-MM-DDThh:mm:ss±hh:mm

For example, 2015-08-27T09:49:58-05:00. The ±hh:mm value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is -05:00.

is_public body boolean Whether the flavor is public (available to all projects) or scoped to a set of projects. Default is True if not specified.
disabled (Optional) body boolean Whether or not the flavor has been administratively disabled.

Example Show Flavor Details

{
    "description": "this is a test flavor",
    "links": [
        {
            "href": "http://10.3.150.17:6688/v1/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
            "rel": "self"
        },
        {
            "href": "http://10.3.150.17:6688/flavors/7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
            "rel": "bookmark"
        }
    ],
    "resources": {
        "CUSTOM_BAREMETAL_GOLD": 1
    },
    "resource_aggregates": {
        "high_mem": "true"
    },
    "created_at": "2016-09-27T02:37:21.966342+00:00",
    "uuid": "7de2859d-ec6d-42c7-bb86-9d630ba5ac94",
    "updated_at": null,
    "is_public": true,
    "disabled": false,
    "name": "test_flavor"
}
DELETE
/flavors/{flavor_uuid}

Delete Flavor

Deletes a flavor.

This is typically an admin only action. Deleting a flavor that is in use by existing servers is not recommended as it can cause incorrect data to be returned to the user under some operations.

Normal response codes: 204

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)

Request

Name In Type Description
flavor_uuid path string The UUID of the flavor.

Response

No body content is returned on a successful DELETE.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.