From 82042ac2766b892d561836cd312656940522734a Mon Sep 17 00:00:00 2001 From: ivan-zhu Date: Wed, 21 Nov 2012 15:37:52 +0800 Subject: Add agent build API support for list/create/delete/modify agent build This adds an extension that provides REST API for list/create/delete/ modify agent build. The interface is accessed via GET /v2/{tenant_id}/os-agents PUT /v2/{tenant_id}/os-agents/id POST /v2/{tenant_id}/os-agents DELETE /v2/{tenant_id}/os-agents And this patch also create tests to get agent build API Samples. DocImpact Implements one workitem of blueprint apis-for-nova-manage The agent is talking about guest agent.The host can use this for things like accessing files on the disk, configuring networking, or running other applications/scripts in the guest while it is running. Typically this uses some hypervisor-specific transport to avoid being dependent on a working network configuration. Xen, VMware, and VirtualBox have guest agents,although the Xen driver is the only one with an implementation for managing them in openstack. KVM doesn't really have a concept of a guest agent (although one could be written). You can find the design of agent update in this link: http://wiki.openstack.org/AgentUpdate and find the code in nova.virt.xenapi.vmops.VMOps._boot_new_instance. In this design We need update agent in guest from host, so we need some interfaces to update the agent info in host. You can find more information about the design of the GuestAgent in the following link: http://wiki.openstack.org/GuestAgent http://wiki.openstack.org/GuestAgentXenStoreCommunication DocImpact Change-Id: I5830388a894efce5b13680fc6916e0cd81a16624 --- doc/api_samples/all_extensions/extensions-get-resp.json | 8 ++++++++ doc/api_samples/all_extensions/extensions-get-resp.xml | 3 +++ doc/api_samples/os-agents/agent-post-req.json | 10 ++++++++++ doc/api_samples/os-agents/agent-post-req.xml | 9 +++++++++ doc/api_samples/os-agents/agent-post-resp.json | 11 +++++++++++ doc/api_samples/os-agents/agent-post-resp.xml | 10 ++++++++++ doc/api_samples/os-agents/agent-update-put-req.json | 7 +++++++ doc/api_samples/os-agents/agent-update-put-req.xml | 6 ++++++ doc/api_samples/os-agents/agent-update-put-resp.json | 8 ++++++++ doc/api_samples/os-agents/agent-update-put-resp.xml | 7 +++++++ doc/api_samples/os-agents/agents-get-resp.json | 13 +++++++++++++ doc/api_samples/os-agents/agents-get-resp.xml | 4 ++++ 12 files changed, 96 insertions(+) create mode 100644 doc/api_samples/os-agents/agent-post-req.json create mode 100644 doc/api_samples/os-agents/agent-post-req.xml create mode 100644 doc/api_samples/os-agents/agent-post-resp.json create mode 100644 doc/api_samples/os-agents/agent-post-resp.xml create mode 100644 doc/api_samples/os-agents/agent-update-put-req.json create mode 100644 doc/api_samples/os-agents/agent-update-put-req.xml create mode 100644 doc/api_samples/os-agents/agent-update-put-resp.json create mode 100644 doc/api_samples/os-agents/agent-update-put-resp.xml create mode 100644 doc/api_samples/os-agents/agents-get-resp.json create mode 100644 doc/api_samples/os-agents/agents-get-resp.xml (limited to 'doc') diff --git a/doc/api_samples/all_extensions/extensions-get-resp.json b/doc/api_samples/all_extensions/extensions-get-resp.json index 399d937a7..cf3d66a76 100644 --- a/doc/api_samples/all_extensions/extensions-get-resp.json +++ b/doc/api_samples/all_extensions/extensions-get-resp.json @@ -64,6 +64,14 @@ "namespace": "http://docs.openstack.org/compute/ext/admin-actions/api/v1.1", "updated": "2011-09-20T00:00:00+00:00" }, + { + "alias": "os-agents", + "description": "Agents support", + "links": [], + "name": "Agents", + "namespace": "http://docs.openstack.org/compute/ext/agents/api/v2", + "updated": "2012-10-28T00:00:00-00:00" + }, { "alias": "os-aggregates", "description": "Admin-only aggregate administration", diff --git a/doc/api_samples/all_extensions/extensions-get-resp.xml b/doc/api_samples/all_extensions/extensions-get-resp.xml index e4d3b8cc3..44816c09c 100644 --- a/doc/api_samples/all_extensions/extensions-get-resp.xml +++ b/doc/api_samples/all_extensions/extensions-get-resp.xml @@ -28,6 +28,9 @@ resetNetwork, injectNetworkInfo, lock, unlock, createBackup + + Agents support + Admin-only aggregate administration diff --git a/doc/api_samples/os-agents/agent-post-req.json b/doc/api_samples/os-agents/agent-post-req.json new file mode 100644 index 000000000..217993b17 --- /dev/null +++ b/doc/api_samples/os-agents/agent-post-req.json @@ -0,0 +1,10 @@ +{ + "agent": { + "hypervisor": "hypervisor", + "os": "os", + "architecture": "x86", + "version": "8.0", + "md5hash": "add6bb58e139be103324d04d82d8f545", + "url": "xxxxxxxxxxxx" + } +} \ No newline at end of file diff --git a/doc/api_samples/os-agents/agent-post-req.xml b/doc/api_samples/os-agents/agent-post-req.xml new file mode 100644 index 000000000..be93e97ce --- /dev/null +++ b/doc/api_samples/os-agents/agent-post-req.xml @@ -0,0 +1,9 @@ + + + hypervisor + os + x86 + 8.0 + add6bb58e139be103324d04d82d8f545 + xxxxxxxxxxxx + \ No newline at end of file diff --git a/doc/api_samples/os-agents/agent-post-resp.json b/doc/api_samples/os-agents/agent-post-resp.json new file mode 100644 index 000000000..418d11f50 --- /dev/null +++ b/doc/api_samples/os-agents/agent-post-resp.json @@ -0,0 +1,11 @@ +{ + "agent": { + "agent_id": "1", + "architecture": "x86", + "hypervisor": "hypervisor", + "md5hash": "add6bb58e139be103324d04d82d8f545", + "os": "os", + "url": "xxxxxxxxxxxx", + "version": "8.0" + } +} \ No newline at end of file diff --git a/doc/api_samples/os-agents/agent-post-resp.xml b/doc/api_samples/os-agents/agent-post-resp.xml new file mode 100644 index 000000000..79f62b7fb --- /dev/null +++ b/doc/api_samples/os-agents/agent-post-resp.xml @@ -0,0 +1,10 @@ + + + xxxxxxxxxxxx + hypervisor + add6bb58e139be103324d04d82d8f545 + 8.0 + x86 + os + 1 + \ No newline at end of file diff --git a/doc/api_samples/os-agents/agent-update-put-req.json b/doc/api_samples/os-agents/agent-update-put-req.json new file mode 100644 index 000000000..e4eaf5352 --- /dev/null +++ b/doc/api_samples/os-agents/agent-update-put-req.json @@ -0,0 +1,7 @@ +{ + "para": { + "url": "xxx://xxxx/xxx/xxx", + "md5hash": "add6bb58e139be103324d04d82d8f545", + "version": "7.0" + } +} \ No newline at end of file diff --git a/doc/api_samples/os-agents/agent-update-put-req.xml b/doc/api_samples/os-agents/agent-update-put-req.xml new file mode 100644 index 000000000..f759880c1 --- /dev/null +++ b/doc/api_samples/os-agents/agent-update-put-req.xml @@ -0,0 +1,6 @@ + + + 7.0 + xxx://xxxx/xxx/xxx + add6bb58e139be103324d04d82d8f545 + \ No newline at end of file diff --git a/doc/api_samples/os-agents/agent-update-put-resp.json b/doc/api_samples/os-agents/agent-update-put-resp.json new file mode 100644 index 000000000..6b67222c8 --- /dev/null +++ b/doc/api_samples/os-agents/agent-update-put-resp.json @@ -0,0 +1,8 @@ +{ + "agent": { + "agent_id": "1", + "md5hash": "add6bb58e139be103324d04d82d8f545", + "url": "xxx://xxxx/xxx/xxx", + "version": "7.0" + } +} \ No newline at end of file diff --git a/doc/api_samples/os-agents/agent-update-put-resp.xml b/doc/api_samples/os-agents/agent-update-put-resp.xml new file mode 100644 index 000000000..badf2750e --- /dev/null +++ b/doc/api_samples/os-agents/agent-update-put-resp.xml @@ -0,0 +1,7 @@ + + + xxx://xxxx/xxx/xxx + 7.0 + 1 + add6bb58e139be103324d04d82d8f545 + \ No newline at end of file diff --git a/doc/api_samples/os-agents/agents-get-resp.json b/doc/api_samples/os-agents/agents-get-resp.json new file mode 100644 index 000000000..36eac4ced --- /dev/null +++ b/doc/api_samples/os-agents/agents-get-resp.json @@ -0,0 +1,13 @@ +{ + "agents": [ + { + "agent_id": "1", + "architecture": "x86", + "hypervisor": "hypervisor", + "md5hash": "add6bb58e139be103324d04d82d8f545", + "os": "os", + "url": "xxxxxxxxxxxx", + "version": "8.0" + } + ] +} \ No newline at end of file diff --git a/doc/api_samples/os-agents/agents-get-resp.xml b/doc/api_samples/os-agents/agents-get-resp.xml new file mode 100644 index 000000000..4194f62c9 --- /dev/null +++ b/doc/api_samples/os-agents/agents-get-resp.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file -- cgit