Updated Blazar API v1 doc

Partial-Bug: #1662741

Change-Id: Iac48bfd8b3102e983f80bbf4a168b68b84bc0e5c
This commit is contained in:
Tejaswi Bachu 2017-02-21 22:33:24 +05:30
parent 51c093b0b6
commit fa6335fe4a
1 changed files with 352 additions and 246 deletions

View File

@ -76,50 +76,68 @@ are mentioned.
.. sourcecode:: json
[
{
"created_at": "2014-02-26 10:00:00",
"end_date": "2345",
"events": [
{
"created_at": "2014-02-26 10:00:00",
"event_type": "start_lease",
"id": "event_id_1",
"lease_id": "aaaa-bbbb-cccc-dddd",
"status": "UNDONE",
"time": "1234",
"updated_at": null
},
{
"created_at": "2014-02-26 10:25:52",
"event_type": "end_lease",
"id": "event_id_2",
"lease_id": "aaaa-bbbb-cccc-dddd",
"status": "UNDONE",
"time": "2345",
"updated_at": null
}
],
"id": "aaaa-bbbb-cccc-dddd",
"name": "lease_foo",
"reservations": [
{
"created_at": "2014-02-26 10:00:00",
"id": "reservation_id",
"lease_id": "aaaa-bbbb-cccc-dddd",
"resource_id": "1234-1234-1234",
"resource_type": "virtual:instance",
"status": "pending",
"updated_at": null
}
],
"start_date": "1234",
"project_id": "project_id",
"trust_id": "trust_id",
"updated_at": null,
"user_id": "user_id"
}
]
{
"leases": [
{
"status": null,
"user_id": null,
"name": "lease_foo",
"end_date": "2017-02-24T20:00:00.000000",
"reservations": [
{
"status": "pending",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"min": 1,
"max": 1,
"resource_id": "5",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"hypervisor_properties": "[\"==\", \"$hypervisor_hostname\", \"compute\"]",
"resource_properties": "",
"id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
"resource_type": "physical:host"
}
],
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"events": [
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "start_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"time": "2017-02-21T20:00:00.000000",
"id": "188a8584-f832-4df9-9a4a-51e6364420ff"
},
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "end_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"time": "2017-02-24T20:00:00.000000",
"id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56"
},
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "before_end_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"time": "2017-02-22T20:00:00.000000",
"id": "f583af71-ca21-4b66-87de-52211d118029"
}
],
"id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"action": null,
"project_id": "aa45f56901ef45ee95e3d211097c0ea3",
"status_reason": null,
"start_date": "2017-02-21T20:00:00.000000",
"trust_id": "b442a580b9504ababf305bf2b4c49512"
}
]
}
2.2 Create new lease
--------------------
@ -141,12 +159,15 @@ are mentioned.
{
"name": "lease_foo",
"start_date": "1234",
"end_date": "2345",
"start_date": "2017-2-21 20:00",
"end_date": "2017-2-24 20:00",
"reservations": [
{
"resource_id": "1234-1234-1234",
"resource_type": "virtual:instance"
"hypervisor_properties": "[\"==\", \"$hypervisor_hostname\", \"compute\"]",
"max": 1,
"min": 1,
"resource_type": "physical:host",
"resource_properties": ""
}
],
"events": []
@ -162,47 +183,67 @@ are mentioned.
.. sourcecode:: json
{
"created_at": "2014-02-26 10:00:00",
"end_date": "2345",
"events": [
{
"created_at": "2014-02-26 10:00:00",
"event_type": "start_lease",
"id": "event_id_1",
"lease_id": "aaaa-bbbb-cccc-dddd",
"status": "UNDONE",
"time": "1234",
"updated_at": null
},
{
"created_at": "2014-02-26 10:25:52",
"event_type": "end_lease",
"id": "event_id_2",
"lease_id": "aaaa-bbbb-cccc-dddd",
"status": "UNDONE",
"time": "2345",
"updated_at": null
}
],
"id": "aaaa-bbbb-cccc-dddd",
"name": "lease_foo",
"reservations": [
{
"created_at": "2014-02-26 10:00:00",
"id": "reservation_id",
"lease_id": "aaaa-bbbb-cccc-dddd",
"resource_id": "1234-1234-1234",
"resource_type": "virtual:instance",
"status": "pending",
"updated_at": null
}
],
"start_date": "1234",
"project_id": "project_id",
"trust_id": "trust_id",
"updated_at": null,
"user_id": "user_id"
}
"lease":
{
"status": null,
"user_id": null,
"name": "lease_foo",
"end_date": "2017-02-24T20:00:00.000000",
"reservations": [
{
"status": "pending",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"min": 1,
"max": 1,
"hypervisor_properties": "[\"==\", \"$hypervisor_hostname\", \"compute\"]",
"resource_id": "5",
"resource_properties": "",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
"resource_type": "physical:host"
}
],
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"events": [
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "start_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"time": "2017-02-21T20:00:00.000000",
"id": "188a8584-f832-4df9-9a4a-51e6364420ff"
},
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "end_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"time": "2017-02-24T20:00:00.000000",
"id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56"
},
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "before_end_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"time": "2017-02-22T20:00:00.000000",
"id": "f583af71-ca21-4b66-87de-52211d118029"
}
],
"id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"action": null,
"project_id": "aa45f56901ef45ee95e3d211097c0ea3",
"status_reason": null,
"start_date": "2017-02-21T20:00:00.000000",
"trust_id": "b442a580b9504ababf305bf2b4c49512"
}
}
2.3 Show info about lease
-------------------------
@ -218,7 +259,7 @@ are mentioned.
.. sourcecode:: http
GET /v1/leases/aaaa-bbbb-cccc-dddd HTTP/1.1
GET /v1/leases/6ee55c78-ac52-41a6-99af-2d2d73bcc466 HTTP/1.1
**response**
@ -230,46 +271,65 @@ are mentioned.
.. sourcecode:: json
{
"created_at": "2014-02-26 10:00:00",
"end_date": "2345",
"events": [
{
"created_at": "2014-02-26 10:00:00",
"event_type": "start_lease",
"id": "event_id_1",
"lease_id": "aaaa-bbbb-cccc-dddd",
"status": "UNDONE",
"time": "1234",
"updated_at": null
},
{
"created_at": "2014-02-26 10:25:52",
"event_type": "end_lease",
"id": "event_id_2",
"lease_id": "aaaa-bbbb-cccc-dddd",
"status": "UNDONE",
"time": "2345",
"updated_at": null
}
],
"id": "aaaa-bbbb-cccc-dddd",
"name": "lease_foo",
"reservations": [
{
"created_at": "2014-02-26 10:00:00",
"id": "reservation_id",
"lease_id": "aaaa-bbbb-cccc-dddd",
"resource_id": "1234-1234-1234",
"resource_type": "virtual:instance",
"status": "pending",
"updated_at": null
}
],
"start_date": "1234",
"project_id": "project_id",
"trust_id": "trust_id",
"updated_at": null,
"user_id": "user_id"
"lease":
{
"status": null,
"user_id": null,
"name": "lease_foo",
"end_date": "2017-02-24T20:00:00.000000",
"reservations": [
{
"status": "pending",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"min": 1,
"max": 1,
"resource_id": "5",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"hypervisor_properties": "[\"==\", \"$hypervisor_hostname\", \"compute\"]",
"resource_properties": "",
"id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
"resource_type": "physical:host"
}
],
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"events": [
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "start_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"time": "2017-02-21T20:00:00.000000",
"id": "188a8584-f832-4df9-9a4a-51e6364420ff"
},
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "end_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"time": "2017-02-24T20:00:00.000000",
"id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56"
},
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "before_end_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"time": "2017-02-22T20:00:00.000000",
"id": "f583af71-ca21-4b66-87de-52211d118029"
}
],
"id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"action": null,
"project_id": "aa45f56901ef45ee95e3d211097c0ea3",
"status_reason": null,
"start_date": "2017-02-21T20:00:00.000000",
"trust_id": "b442a580b9504ababf305bf2b4c49512"
}
}
2.4 Update existing lease
@ -286,13 +346,13 @@ are mentioned.
.. sourcecode:: http
PUT /v1/leases/aaaa-bbbb-cccc-dddd HTTP/1.1
PUT /v1/leases/6ee55c78-ac52-41a6-99af-2d2d73bcc466 HTTP/1.1
.. sourcecode:: json
{
"name": "new_name",
"end_date": "new_date",
"name": "lease_new_foo",
"end_date": "2017-3-12 12:00",
}
**response**
@ -305,46 +365,65 @@ are mentioned.
.. sourcecode:: json
{
"created_at": "2014-02-26 10:00:00",
"end_date": "new_date",
"events": [
{
"created_at": "2014-02-26 10:00:00",
"event_type": "start_lease",
"id": "event_id_1",
"lease_id": "aaaa-bbbb-cccc-dddd",
"status": "UNDONE",
"time": "1234",
"updated_at": null
},
{
"created_at": "2014-02-26 10:25:52",
"event_type": "end_lease",
"id": "event_id_2",
"lease_id": "aaaa-bbbb-cccc-dddd",
"status": "UNDONE",
"time": "2345",
"updated_at": null
}
],
"id": "aaaa-bbbb-cccc-dddd",
"name": "new_name",
"reservations": [
{
"created_at": "2014-02-26 10:00:00",
"id": "reservation_id",
"lease_id": "aaaa-bbbb-cccc-dddd",
"resource_id": "1234-1234-1234",
"resource_type": "virtual:instance",
"status": "pending",
"updated_at": null
}
],
"start_date": "1234",
"project_id": "project_id",
"trust_id": "trust_id",
"updated_at": null,
"user_id": "user_id"
"lease":
{
"status": null,
"user_id": null,
"name": "lease_new_foo",
"end_date": "2017-03-12T12:00:00.000000",
"reservations": [
{
"status": "pending",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"min": 1,
"max": 1,
"resource_id": "5",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"hypervisor_properties": "[\"==\", \"$hypervisor_hostname\", \"compute\"]",
"resource_properties": "",
"id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
"resource_type": "physical:host"
}
],
"created_at": "2017-02-21 14:50:38",
"updated_at": "2017-02-21 14:56:32",
"events": [
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "start_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": null,
"time": "2017-02-21T20:00:00.000000",
"id": "188a8584-f832-4df9-9a4a-51e6364420ff"
},
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "end_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": "2017-02-21 14:56:32",
"time": "2017-03-12T12:00:00.000000",
"id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56"
},
{
"status": "UNDONE",
"lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"event_type": "before_end_lease",
"created_at": "2017-02-21 14:50:38",
"updated_at": "2017-02-21 14:56:32",
"time": "2017-03-10T12:00:00.000000",
"id": "f583af71-ca21-4b66-87de-52211d118029"
}
],
"id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
"action": null,
"project_id": "aa45f56901ef45ee95e3d211097c0ea3",
"status_reason": null,
"start_date": "2017-02-21T20:00:00.000000",
"trust_id": "b442a580b9504ababf305bf2b4c49512"
}
}
2.5 Delete existing lease
@ -360,7 +439,7 @@ are mentioned.
.. sourcecode:: http
DELETE /v1/leases/aaaa-bbbb-cccc-dddd HTTP/1.1
DELETE /v1/leases/6ee55c78-ac52-41a6-99af-2d2d73bcc466 HTTP/1.1
**response**
@ -426,34 +505,56 @@ user query.
.. sourcecode:: json
[
{
"cpu_info": "{'some_cpu_info': 'some_cpu_info'}",
"created_at": "2014-01-01 08:00:00",
"hypervisor_hostname": "compute1",
"hypervisor_type": "QEMU",
"hypervisor_version": 1000000,
"id": "1",
"local_gb": 8,
"memory_mb": 3954,
"status": null,
"updated_at": null,
"vcpus": 2
},
{
"cpu_info": "{'some_cpu_info': 'some_cpu_info'}",
"created_at": "2014-01-01 09:00:00",
"hypervisor_hostname": "compute2",
"hypervisor_type": "QEMU",
"hypervisor_version": 1000000,
"id": "2",
"local_gb": 8,
"memory_mb": 3954,
"status": null,
"updated_at": null,
"vcpus": 2
}
]
{
"hosts": [
{
"status": null,
"hypervisor_type": "QEMU",
"created_at": "2017-02-21 14:29:55",
"updated_at": null,
"hypervisor_hostname": "compute-1",
"memory_mb": 5968,
"cpu_info": "{'vendor': 'Intel', 'model': 'pentium',
'arch': 'x86_64', 'features': [
'lahf_lm', 'lm', 'nx', 'syscall', 'hypervisor',
'aes', 'popcnt', 'x2apic', 'sse4.2', 'cx16',
'ssse3', 'pni', 'ss', 'sse2', 'sse', 'fxsr',
'clflush', 'pse36', 'pat', 'cmov', 'mca',
'pge', 'mtrr', 'apic', 'pae'],
'topology': {
'cores': 1, 'threads': 1, 'sockets': 2, 'cells': 1}}",
"vcpus": 1,
"service_name": "blazar",
"hypervisor_version": 2005000,
"local_gb": 13,
"id": "1",
"trust_id": "454ebdadd56142c896571d749ea86e95"
},
{
"status": null,
"hypervisor_type": "QEMU",
"created_at": "2017-02-20 12:20:31",
"updated_at": null,
"hypervisor_hostname": "compute-2",
"memory_mb": 5968,
"cpu_info": "{'vendor': 'Intel', 'model': 'pentium',
'arch': 'x86_64', 'features': [
'lahf_lm', 'lm', 'nx', 'syscall', 'hypervisor',
'aes', 'popcnt', 'x2apic', 'sse4.2', 'cx16',
'ssse3', 'pni', 'ss', 'sse2', 'sse', 'fxsr',
'clflush', 'pse36', 'pat', 'cmov', 'mca',
'pge', 'mtrr', 'apic', 'pae'],
'topology': {
'cores': 2, 'threads': 2, 'sockets': 2, 'cells': 1}}",
"vcpus": 1,
"service_name": "blazar",
"hypervisor_version": 2005000,
"local_gb": 20,
"id": "2",
"trust_id": "345adbead12345c769081d971ea86e36"
}
]
}
3.2 Create host
---------------
@ -475,10 +576,7 @@ user query.
.. sourcecode:: json
{
"name": "compute",
"values": {
"banana": "true"
}
"name": "compute"
}
**response**
@ -491,26 +589,30 @@ user query.
.. sourcecode:: json
{
"banana": "true",
"cpu_info": "{'vendor': 'Intel', 'model': 'pentium',
'arch': 'x86_64', 'features': [
'lahf_lm', 'lm', 'nx', 'syscall', 'hypervisor',
'aes', 'popcnt', 'x2apic', 'sse4.2', 'cx16',
'ssse3', 'pni', 'ss', 'sse2', 'sse', 'fxsr',
'clflush', 'pse36', 'pat', 'cmov', 'mca',
'pge', 'mtrr', 'apic', 'pae'],
'topology': {
'cores': 1, 'threads': 1, 'sockets': 2}}",
"created_at": "2014-02-26 08:00:00",
"hypervisor_hostname": "compute",
"hypervisor_type": "QEMU",
"hypervisor_version": 1000000,
"id": "1",
"local_gb": 8,
"memory_mb": 3954,
"status": null,
"updated_at": null,
"vcpus": 2
"host":
{
"status": null,
"hypervisor_type": "QEMU",
"created_at": "2017-02-21 14:29:55",
"updated_at": null,
"hypervisor_hostname": "compute",
"memory_mb": 5968,
"cpu_info": "{'vendor': 'Intel', 'model': 'pentium',
'arch': 'x86_64', 'features': [
'lahf_lm', 'lm', 'nx', 'syscall', 'hypervisor',
'aes', 'popcnt', 'x2apic', 'sse4.2', 'cx16',
'ssse3', 'pni', 'ss', 'sse2', 'sse', 'fxsr',
'clflush', 'pse36', 'pat', 'cmov', 'mca',
'pge', 'mtrr', 'apic', 'pae'],
'topology': {
'cores': 1, 'threads': 1, 'sockets': 2, 'cells': 1}}",
"vcpus": 1,
"service_name": "blazar",
"hypervisor_version": 2005000,
"local_gb": 13,
"id": "1",
"trust_id": "454ebdadd56142c896571d749ea86e95"
}
}
3.3 Show info about host
@ -540,26 +642,30 @@ user query.
.. sourcecode:: json
{
"banana": "true",
"cpu_info": "{'vendor': 'Intel', 'model': 'pentium',
'arch': 'x86_64', 'features': [
'lahf_lm', 'lm', 'nx', 'syscall', 'hypervisor',
'aes', 'popcnt', 'x2apic', 'sse4.2', 'cx16',
'ssse3', 'pni', 'ss', 'sse2', 'sse', 'fxsr',
'clflush', 'pse36', 'pat', 'cmov', 'mca',
'pge', 'mtrr', 'apic', 'pae'],
'topology': {
'cores': 1, 'threads': 1, 'sockets': 2}}",
"created_at": "2014-02-26 08:00:00",
"hypervisor_hostname": "compute",
"hypervisor_type": "QEMU",
"hypervisor_version": 1000000,
"id": "1",
"local_gb": 8,
"memory_mb": 3954,
"status": null,
"updated_at": null,
"vcpus": 2
"host":
{
"status": null,
"hypervisor_type": "QEMU",
"created_at": "2017-02-21 14:29:55",
"updated_at": null,
"hypervisor_hostname": "blazar",
"memory_mb": 5968,
"cpu_info": "{'vendor': 'Intel', 'model': 'pentium',
'arch': 'x86_64', 'features': [
'lahf_lm', 'lm', 'nx', 'syscall', 'hypervisor',
'aes', 'popcnt', 'x2apic', 'sse4.2', 'cx16',
'ssse3', 'pni', 'ss', 'sse2', 'sse', 'fxsr',
'clflush', 'pse36', 'pat', 'cmov', 'mca',
'pge', 'mtrr', 'apic', 'pae'],
'topology': {
'cores': 1, 'threads': 1, 'sockets': 2, 'cells': 1}}",
"vcpus": 1,
"service_name": "blazar",
"hypervisor_version": 2005000,
"local_gb": 13,
"id": "1",
"trust_id": "454ebdadd56142c896571d749ea86e95"
}
}
3.4 Update existing host