Jump to: navigation, search

Difference between revisions of "Neutron/DeviceInventory"

Line 6: Line 6:
 
Device Inventory Management is the central control point for appliances that offer [[Quantum/ServiceInsertion|advanced services]] in Quantum.
 
Device Inventory Management is the central control point for appliances that offer [[Quantum/ServiceInsertion|advanced services]] in Quantum.
  
Rationale: Some vendor implementation may require storing available appliances and their parameters to choose to which instance logical configuration will be deployed. Such component should be made generic to support different kinds of service devices: loadbalancer, VPN, firewall, etc.
+
Rationale: Some vendor drivers may require storing available appliances and their parameters to choose to which instance logical configuration will be deployed. Such component should be made generic to support different kinds of service devices: loadbalancer, VPN, firewall, etc.
  
 
== Device Model ==
 
== Device Model ==

Revision as of 07:57, 14 May 2013

Device Inventory Management

Device Inventory Management is the central control point for appliances that offer advanced services in Quantum.

Rationale: Some vendor drivers may require storing available appliances and their parameters to choose to which instance logical configuration will be deployed. Such component should be made generic to support different kinds of service devices: loadbalancer, VPN, firewall, etc.

Device Model

Attribute Type CRUD Required Default Value Comments
id uuid CR y generated
name string CRU n none
service_types uuid_list CRU y [] list of service type uuids that the device covers
management object CRU n none address, credentials, etc.
shared boolean CR n true shows whether the device can be shared among tenants
tenant_id uuid CR n none
capabilities object R n none

Example

{
    "id": "f2bf34e0-28b6-4ce5-93aa-8bab56259cad",
    "name": "HAP-001",
    "service_types": ["db902c0c-d5ff-4753-b465-668ad9656918"],
    "shared": "true",
    "management": {
        "address": "10.0.0.6",
        "port": 22,
        "user": "user",
        "password": "swordfish"
    }
    "capabilities": {
        "lb_methods": [
            "ROUND_ROBIN",
            "STATIC_RR"
        ],
        "protocols": [
            "TCP",
            "HTTP"
        ],
        "healthMonitors": [
            "ICMP",
            "HTTP"
        ],
        "sessionPersistences": [
            "HTTP_COOKIE",
            "SOURCE_IP"
        ]
}

API commands:

Verb URI Comments
GET /v2.0/devices
POST /v2.0/devices admin only
GET /v2.0/devices/{device_id}
UPDATE /v2.0/devices/{device_id} admin only
DELETE /v2.0/devices/{device_id} admin only

List devices

Verb URI
GET /devices

Normal Response Code: 200

Error Response Codes: Unauthorized (401)

This operation does not require a request body, unless the Quantum server is running without Keystone integration.

This operation returns a response body.

JSON Request:

GET /v2.0/devices
Accept: application/json


JSON Response:

{
    "devices": [
        {
            "id": "f2bf34e028b64ce593aa8bab56259cad",
            "name": "HAP-001",
            "service_types": ["db902c0c-d5ff-4753-b465-668ad9656918"],
            "shared": "true",
            "management": {
                "address": "10.0.0.6",
                "port": 22,
                "user": "user",
                "password": "swordfish"
            },
            "capabilities": {
                "lb_methods": [
                    "STATIC_RR",
                    "ROUND_ROBIN",
                ],
                "protocols": [
                    "TCP",
                    "HTTP"
                ],
                "healthMonitors": [
                    "ICMP",
                    "HTTP_GET",
                ],
                "sessionPersistences": [
                    "COOKIE",
                    "SRC_ADDR"
                ]
            }
        }
    ]
}


Show device

Verb URI
GET /devices/{device_id}

Normal Response Code: 200

Error Response Codes: Unauthorized (401), Not Found (404)

This operation does not require a request body, unless the Quantum server is running without Keystone integration.

This operation returns a response body.

JSON Request:

GET /v2.0/devices/{afc75773-640e-403c-9fff-62ba98db1f19}
Accept: application/json


JSON Response:

{
    "device": {
        "id": "f2bf34e028b64ce593aa8bab56259cad",
        "name": "HAP-001",
        "service_types": ["db902c0c-d5ff-4753-b465-668ad9656918"],
        "shared": "true",
        "management": {
            "address": "10.0.0.6",
            "port": 22,
            "user": "user",
            "password": "swordfish"
        },
        "capabilities": {
            "lb_methods": [
                "STATIC_RR",
                "ROUND_ROBIN",
                "HASH_SOURCE",
                "LEAST_CONNECTION",
                "HASH_URI"
            ],
            "protocols": [
                "TCP",
                "HTTP"
            ],
            "healthMonitors": [
                "ICMP",
                "HTTP_GET",
                "HTTP_HEAD"
            ],
            "sessionPersistences": [
                "COOKIE",
                "SRC_ADDR"
            ]
        }
    }
}


Create Device

Verb URI
POST /devices

Normal Response Code: 201

Error Response Codes: Bad Request (400) Unauthorized (401)

This operation requires a request body. The request body must contain a network object that specifies a symbolic name for the network.

This operation returns a response body.

JSON Request:

POST /v2.0/devices
Content-Type: application/json
Accept: application/json


{
    "device": {
        "name": "HAP-001",
        "service_types": ["db902c0c-d5ff-4753-b465-668ad9656918"],
        "shared": "false", 
        "tenant_id": "f2bf34e028b64ce593aa8bab56259cad",
        "management": {
            "address": "10.0.0.6",
            "port": 22,
            "user": "user",
            "password": "swordfish"
        }
    }
}


JSON Response:

{
    "device": {
        "id": "f2bf34e028b64ce593aa8bab56259cad",
        "name": "HAP-001",
        "service_types": ["db902c0c-d5ff-4753-b465-668ad9656918"],
        "is_public": "true", 
        "management": {
            "address": "10.0.0.6",
            "port": 22,
            "user": "user",
            "password": "swordfish"
        }
    }
}


Update Device

Verb URI
PUT /devices/{device_id}

Normal Response Code: 200

Error Response Codes: Bad Request (400) Unauthorized (401), Forbidden (403) Not Found (404)

This operation requires a request body. You can set the following attributes in the request body:

Attribute
name
management

If update of any other attributes is asked, a 400 Bad Request error is returned. Note: like in Quantum, update operations adopt patch semantics. This implies that user is not required to send the whole resource to be updated, but just the attributes that the user wishes to update, as shown in the following example.

This operation returns a response body.

JSON Request:

PUT /v2.0/devices/fc68ea2c-b60b-4b4f-bd82-94ec81110766
Content-Type: application/json
Accept: application/json


{
    "device": {
        "name": "HAP-001-new",
    }
}


JSON Response:

status: 200
content-length: 192
content-type: application/json

{
    "device": {
        "id": "f2bf34e028b64ce593aa8bab56259cad",
        "name": "HAP-001-new",
        "type": "virtual_load_balancing",
        "is_public": "true", 
        "management": {
            "address": "10.0.0.6",
            "port": 22,
            "user": "user",
            "password": "swordfish"
        }
    }
}


Delete Device

Verb URI
DELETE /devices/{device_id}

Normal Response Code: 204

Error Response Codes: Unauthorized (401), Not Found (404)

This operation does not require a request body.

This operation does not return a response body.

JSON Request:

DELETE /v2.0/devices/{afc75773-640e-403c-9fff-62ba98db1f19}
Accept: application/json


JSON Response:

status: 204