Skip to content

Commit

Permalink
Implements Scheduled Images Extension
Browse files Browse the repository at this point in the history
The extension creates a new resource under servers/id to get, create
and delete it's scheduled image.

On the servers list and detail calls, it adds the system metadata
related to scheduled image service on the server dict in the response
object. It also enables filtering by the system metadata added by the
scheduled images service and if it exists, adds it on the servers
dictonaries.

bp https://blueprints.launchpad.net/nova/+spec/scheduled-images

Squashed:

Add username to schedule image metadata for auth impersonation
  • Loading branch information
Nikhil Komawar authored and ohthree jenkins committed May 16, 2013
1 parent 690c454 commit 6adc8c4
Show file tree
Hide file tree
Showing 55 changed files with 1,411 additions and 59 deletions.
62 changes: 35 additions & 27 deletions doc/api_samples/all_extensions/extensions-get-resp.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,14 @@
"namespace": "http://docs.openstack.org/compute/ext/networks_associate/api/v2",
"updated": "2012-11-19T00:00:00+00:00"
},
{
"alias": "os-networksv2",
"description": "Admin-only Network Management Extension.",
"links": [],
"name": "OSNetworksV2",
"namespace": "http://docs.openstack.org/ext/services/api/v1.1",
"updated": "2012-03-07T09:46:43-05:00"
},
{
"alias": "os-quota-class-sets",
"description": "Quota classes management support.",
Expand Down Expand Up @@ -464,6 +472,14 @@
"namespace": "http://docs.openstack.org/compute/ext/servers/api/v1.1",
"updated": "2012-01-23T00:00:00+00:00"
},
{
"alias": "os-server-uuid",
"description": "Support to show the UUID of networks of instance.",
"links": [],
"name": "ServerUUID",
"namespace": "http://docs.openstack.org/compute/ext/server_uuid/api/v1.1",
"updated": "2012-11-14T00:00:00+00:00"
},
{
"alias": "os-services",
"description": "Services support.",
Expand All @@ -472,6 +488,14 @@
"namespace": "http://docs.openstack.org/compute/ext/services/api/v2",
"updated": "2012-10-28T00:00:00-00:00"
},
{
"alias": "os-si-image-schedule",
"description": "Enables automatic scheduled images to be taken of a server.",
"links": [],
"name": "ScheduledImages",
"namespace": "http://docs.openstack.org/servers/api/ext/scheduled_images/v1.0",
"updated": "2013-03-20T00:00:00+00:00"
},
{
"alias": "os-simple-tenant-usage",
"description": "Simple tenant usage extension.",
Expand Down Expand Up @@ -512,6 +536,14 @@
"namespace": "http://docs.openstack.org/compute/ext/virtual_interfaces/api/v1.1",
"updated": "2011-08-17T00:00:00+00:00"
},
{
"alias": "os-virtual-interfacesv2",
"description": "Virtual interface support.",
"links": [],
"name": "VirtualInterfaces",
"namespace": "http://docs.openstack.org/compute/ext/virtual_interfacesv2/api/v1.1",
"updated": "2011-08-17T00:00:00+00:00"
},
{
"alias": "os-volumes",
"description": "Volumes support.",
Expand All @@ -522,35 +554,11 @@
},
{
"alias": "rax-backup-schedule",
"description": "Backup scheduling support",
"description": "Backup schedule support for instances.",
"links": [],
"name": "Backup_schedule",
"namespace": "http://docs.openstack.org/ext/backup-schedule/api/v1.1",
"updated": "2012-11-27T00:00:00+00:00"
},
{
"alias": "os-networksv2",
"description": "Network support (custom to Rackspace)",
"links": [],
"name": "OSNetworksV2",
"namespace": "http://docs.openstack.org/ext/services/api/v1.1",
"updated": "2012-11-27T00:00:00+00:00"
},
{
"alias": "os-virtual-interfacesv2",
"description": "Virtual interface support (custom to Rackspace)",
"links": [],
"name": "VirtualInterfaces",
"namespace": "http://docs.openstack.org/compute/ext/virtual_interfacesv2/api/v1.1",
"updated": "2012-11-27T00:00:00+00:00"
},
{
"alias": "os-server-uuid",
"description": "Support to show the UUID of networks of instance.",
"links": [],
"name": "ServerUUID",
"namespace": "http://docs.openstack.org/compute/ext/server_uuid/api/v1.1",
"updated": "2012-11-27T00:00:00+00:00"
"updated": "2011-08-18T00:00:00+00:00"
}
]
}
}
27 changes: 15 additions & 12 deletions doc/api_samples/all_extensions/extensions-get-resp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@
<extension alias="os-networks-associate" updated="2012-11-19T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/networks_associate/api/v2" name="NetworkAssociationSupport">
<description>Network association support.</description>
</extension>
<extension alias="os-networksv2" updated="2012-03-07T09:46:43-05:00" namespace="http://docs.openstack.org/ext/services/api/v1.1" name="OSNetworksV2">
<description>Admin-only Network Management Extension.</description>
</extension>
<extension alias="os-quota-class-sets" updated="2012-03-12T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/quota-classes-sets/api/v1.1" name="QuotaClasses">
<description>Quota classes management support.</description>
</extension>
Expand All @@ -192,9 +195,15 @@
<extension alias="os-server-start-stop" updated="2012-01-23T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/servers/api/v1.1" name="ServerStartStop">
<description>Start/Stop instance compute API support.</description>
</extension>
<extension alias="os-server-uuid" updated="2012-11-14T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/server_uuid/api/v1.1" name="ServerUUID">
<description>Support to show the UUID of networks of instance.</description>
</extension>
<extension alias="os-services" updated="2012-10-28T00:00:00-00:00" namespace="http://docs.openstack.org/compute/ext/services/api/v2" name="Services">
<description>Services support.</description>
</extension>
<extension alias="os-si-image-schedule" updated="2013-03-20T00:00:00+00:00" namespace="http://docs.openstack.org/servers/api/ext/scheduled_images/v1.0" name="ScheduledImages">
<description>Enables automatic scheduled images to be taken of a server.</description>
</extension>
<extension alias="os-simple-tenant-usage" updated="2011-08-19T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/os-simple-tenant-usage/api/v1.1" name="SimpleTenantUsage">
<description>Simple tenant usage extension.</description>
</extension>
Expand All @@ -210,19 +219,13 @@
<extension alias="os-virtual-interfaces" updated="2011-08-17T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/virtual_interfaces/api/v1.1" name="VirtualInterfaces">
<description>Virtual interface support.</description>
</extension>
<extension alias="os-virtual-interfacesv2" updated="2011-08-17T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/virtual_interfacesv2/api/v1.1" name="VirtualInterfaces">
<description>Virtual interface support.</description>
</extension>
<extension alias="os-volumes" updated="2011-03-25T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/volumes/api/v1.1" name="Volumes">
<description>Volumes support.</description>
</extension>
<extension alias="rax-backup-schedule" updated="2012-11-27T00:00:00+00:00" namespace="http://docs.openstack.org/ext/backup-schedule/api/v1.1" name="Backup_schedule">
<description>Backup scheduling support</description>
</extension>
<extension alias="os-networksv2" updated="2012-11-27T00:00:00+00:00" namespace="http://docs.openstack.org/ext/services/api/v1.1" name="OSNetworksV2">
<description>Networking support (custom to Rackspace)</description>
</extension>
<extension alias="os-virtual-interfacesv2" updated="2012-11-27T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/virtual_interfacesv2/api/v1.1" name="VirtualInterfaces">
<description>Virtual interface support (custom to Rackspace)</description>
</extension>
<extension alias="os-server-uuid" updated="2012-11-27T00:00:00+00:00" namespace="http://docs.openstack.org/compute/ext/server_uuid/api/v1.1" name="ServerUUID">
<description>Support to show the UUID of networks of instance</description>
<extension alias="rax-backup-schedule" updated="2011-08-18T00:00:00+00:00" namespace="http://docs.openstack.org/ext/backup-schedule/api/v1.1" name="Backup_schedule">
<description>Backup schedule support for instances.</description>
</extension>
</extensions>
</extensions>
11 changes: 5 additions & 6 deletions doc/api_samples/all_extensions/server-get-resp.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns:OS-DCF="http://docs.openstack.org/compute/ext/disk_config/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:OS-EXT-SRV-ATTR="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:OS-EXT-IPS="http://docs.openstack.org/compute/ext/extended_ips/api/v1.1" xmlns:OS-EXT-IPS-MAC="http://docs.openstack.org/compute/ext/extended_ips_mac/api/v1.1" xmlns:OS-EXT-STS="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:OS-EXT-AZ="http://docs.openstack.org/compute/ext/extended_availability_zone/api/v2" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="2013-02-07T19:01:59Z" hostId="06d1cfd52be5f5d197193db2842978235fd085bd2dfaea32e5068468" name="new-server-test" created="2013-02-07T19:01:58Z" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="6be39927-53b2-4aee-8593-1c72b3673168" key_name="None" config_drive="" OS-EXT-SRV-ATTR:vm_state="active" OS-EXT-SRV-ATTR:task_state="None" OS-EXT-SRV-ATTR:power_state="1" OS-EXT-SRV-ATTR:instance_name="instance-00000001" OS-EXT-SRV-ATTR:host="b98603db318e495e819601702d16c512" OS-EXT-SRV-ATTR:hypervisor_hostname="fake-mini" OS-EXT-AZ:availability_zone="nova" OS-DCF:diskConfig="AUTO">
<server xmlns:OS-DCF="http://docs.openstack.org/compute/ext/disk_config/api/v1.1" xmlns:OS-EXT-IPS-MAC="http://docs.openstack.org/compute/ext/extended_ips_mac/api/v1.1" xmlns:OS-EXT-IPS="http://docs.openstack.org/compute/ext/extended_ips/api/v1.1" xmlns:OS-EXT-SRV-ATTR="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:OS-EXT-STS="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:OS-SI="http://docs.openstack.org/servers/api/ext/scheduled_images/v1.0" xmlns:OS-EXT-AZ="http://docs.openstack.org/compute/ext/extended_availability_zone/api/v2" xmlns="http://docs.openstack.org/compute/api/v1.1" status="ACTIVE" updated="2013-04-15T18:57:51Z" hostId="fb02b127a9d6427807b10655fe73aca2fa1642eae2d3e1c963c26d83" name="new-server-test" created="2013-04-15T18:57:45Z" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="49ccbcba-fe53-4b5e-b61d-2df89558444d" key_name="None" config_drive="" OS-EXT-SRV-ATTR:vm_state="active" OS-EXT-SRV-ATTR:task_state="None" OS-EXT-SRV-ATTR:power_state="1" OS-EXT-SRV-ATTR:instance_name="instance-00000001" OS-EXT-SRV-ATTR:host="8c7a7d9ef74c429382ab6af349f288a2" OS-EXT-SRV-ATTR:hypervisor_hostname="null" OS-EXT-AZ:availability_zone="nova" OS-DCF:diskConfig="AUTO">
<image id="70a599e0-31e7-49b7-b260-868f441e862b">
<atom:link href="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
</image>
Expand All @@ -11,13 +11,12 @@
</metadata>
<addresses>
<network id="private">
<ip OS-EXT-IPS:type="fixed" version="4" addr="192.168.0.3"
OS-EXT-IPS-MAC:mac_addr="00:0c:29:e1:42:90"/>
<ip OS-EXT-IPS:type="fixed" version="4" addr="192.168.0.3" OS-EXT-IPS-MAC:mac_addr="aa:bb:cc:dd:ee:ff"/>
</network>
</addresses>
<atom:link href="http://openstack.example.com/v2/openstack/servers/6be39927-53b2-4aee-8593-1c72b3673168" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/6be39927-53b2-4aee-8593-1c72b3673168" rel="bookmark"/>
<atom:link href="http://openstack.example.com/v2/openstack/servers/49ccbcba-fe53-4b5e-b61d-2df89558444d" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/49ccbcba-fe53-4b5e-b61d-2df89558444d" rel="bookmark"/>
<security_groups>
<security_group name="default"/>
</security_groups>
</server>
</server>
12 changes: 6 additions & 6 deletions doc/api_samples/all_extensions/servers-details-resp.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<servers xmlns:OS-DCF="http://docs.openstack.org/compute/ext/disk_config/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:OS-EXT-SRV-ATTR="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:OS-EXT-IPS="http://docs.openstack.org/compute/ext/extended_ips/api/v1.1" xmlns:OS-EXT-IPS-MAC="http://docs.openstack.org/compute/ext/extended_ips_mac/api/v1.1" xmlns:OS-EXT-STS="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:OS-EXT-AZ="http://docs.openstack.org/compute/ext/extended_availability_zone/api/v2" xmlns="http://docs.openstack.org/compute/api/v1.1">
<server status="ACTIVE" updated="2013-02-07T19:01:59Z" hostId="641edaad8dd6a670afec58a4ce7e908d50379a6060f845236cd063db" name="new-server-test" created="2013-02-07T19:01:58Z" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="b45edf9d-30f6-41e8-a00b-ef8962376586" key_name="None" config_drive="" OS-EXT-SRV-ATTR:vm_state="active" OS-EXT-SRV-ATTR:task_state="None" OS-EXT-SRV-ATTR:power_state="1" OS-EXT-SRV-ATTR:instance_name="instance-00000001" OS-EXT-SRV-ATTR:host="f7954cfa4a5544278876b1d9224efe48" OS-EXT-SRV-ATTR:hypervisor_hostname="fake-mini" OS-EXT-AZ:availability_zone="nova" OS-DCF:diskConfig="AUTO">
<servers xmlns:OS-DCF="http://docs.openstack.org/compute/ext/disk_config/api/v1.1" xmlns:OS-EXT-IPS-MAC="http://docs.openstack.org/compute/ext/extended_ips_mac/api/v1.1" xmlns:OS-EXT-IPS="http://docs.openstack.org/compute/ext/extended_ips/api/v1.1" xmlns:OS-EXT-SRV-ATTR="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:OS-EXT-STS="http://docs.openstack.org/compute/ext/extended_status/api/v1.1" xmlns:OS-SI="http://docs.openstack.org/servers/api/ext/scheduled_images/v1.0" xmlns:OS-EXT-AZ="http://docs.openstack.org/compute/ext/extended_availability_zone/api/v2" xmlns="http://docs.openstack.org/compute/api/v1.1">
<server status="ACTIVE" updated="2013-04-15T18:58:01Z" hostId="ebd512540c83aac93e82515102dd806763d39aa9f31ac19379d3a5f9" name="new-server-test" created="2013-04-15T18:57:57Z" userId="fake" tenantId="openstack" accessIPv4="" accessIPv6="" progress="0" id="673a57b0-3138-4dcb-ba4d-11fdcac7a1a6" key_name="None" config_drive="" OS-EXT-SRV-ATTR:vm_state="active" OS-EXT-SRV-ATTR:task_state="None" OS-EXT-SRV-ATTR:power_state="1" OS-EXT-SRV-ATTR:instance_name="instance-00000001" OS-EXT-SRV-ATTR:host="17a0acee1883497fbf5950e123f47979" OS-EXT-SRV-ATTR:hypervisor_hostname="null" OS-EXT-AZ:availability_zone="nova" OS-DCF:diskConfig="AUTO">
<image id="70a599e0-31e7-49b7-b260-868f441e862b">
<atom:link href="http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b" rel="bookmark"/>
</image>
Expand All @@ -12,13 +12,13 @@
</metadata>
<addresses>
<network id="private">
<ip OS-EXT-IPS:type="fixed" version="4" addr="192.168.0.3" OS-EXT-IPS-MAC:mac_addr="00:0c:29:e1:42:90"/>
<ip OS-EXT-IPS:type="fixed" version="4" addr="192.168.0.3" OS-EXT-IPS-MAC:mac_addr="aa:bb:cc:dd:ee:ff"/>
</network>
</addresses>
<atom:link href="http://openstack.example.com/v2/openstack/servers/b45edf9d-30f6-41e8-a00b-ef8962376586" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/b45edf9d-30f6-41e8-a00b-ef8962376586" rel="bookmark"/>
<atom:link href="http://openstack.example.com/v2/openstack/servers/673a57b0-3138-4dcb-ba4d-11fdcac7a1a6" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/673a57b0-3138-4dcb-ba4d-11fdcac7a1a6" rel="bookmark"/>
<security_groups>
<security_group name="default"/>
</security_groups>
</server>
</servers>
</servers>
8 changes: 4 additions & 4 deletions doc/api_samples/all_extensions/servers-list-resp.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8'?>
<servers xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<server name="new-server-test" id="b28017c2-7909-4318-bc47-ba1419f17709">
<atom:link href="http://openstack.example.com/v2/openstack/servers/b28017c2-7909-4318-bc47-ba1419f17709" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/b28017c2-7909-4318-bc47-ba1419f17709" rel="bookmark"/>
<servers xmlns:OS-SI="http://docs.openstack.org/servers/api/ext/scheduled_images/v1.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns="http://docs.openstack.org/compute/api/v1.1">
<server name="new-server-test" id="59a619a2-2374-477e-9d79-4febb191fa80">
<atom:link href="http://openstack.example.com/v2/openstack/servers/59a619a2-2374-477e-9d79-4febb191fa80" rel="self"/>
<atom:link href="http://openstack.example.com/openstack/servers/59a619a2-2374-477e-9d79-4febb191fa80" rel="bookmark"/>
</server>
</servers>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"image_schedule": {
"retention": 6
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<image_schedule xmlns="http://docs.openstack.org/servers/api/ext/scheduled_images/v1.0">
<retention>6</retention>
</image_schedule>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"image_schedule": {
"retention": 7
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<image_schedule xmlns="http://docs.openstack.org/servers/api/ext/scheduled_images/v1.0">
<retention>7</retention>
</image_schedule>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"image_schedule": {
"retention": 7
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version='1.0' encoding='UTF-8'?>
<image_schedule xmlns="http://docs.openstack.org/servers/api/ext/scheduled_images/v1.0">
<retention>7</retention>
</image_schedule>
57 changes: 57 additions & 0 deletions doc/api_samples/os-si-image-schedule/server-get-resp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"server": {
"OS-SI:image_schedule": {
"retention": 7
},
"accessIPv4": "",
"accessIPv6": "",
"addresses": {
"private": [
{
"addr": "192.168.0.3",
"version": 4
}
]
},
"created": "2013-03-29T19:52:15Z",
"flavor": {
"id": "1",
"links": [
{
"href": "http://openstack.example.com/openstack/flavors/1",
"rel": "bookmark"
}
]
},
"hostId": "adeb10e7956e335d42baeeb8cb747bcb8fad96bdf6a33242fc9d0f98",
"id": "af248c5a-9fbd-4657-8272-a4657b514ed8",
"image": {
"id": "70a599e0-31e7-49b7-b260-868f441e862b",
"links": [
{
"href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
"rel": "bookmark"
}
]
},
"links": [
{
"href": "http://openstack.example.com/v2/openstack/servers/af248c5a-9fbd-4657-8272-a4657b514ed8",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/servers/af248c5a-9fbd-4657-8272-a4657b514ed8",
"rel": "bookmark"
}
],
"metadata": {
"My Server Name": "Apache1"
},
"name": "new-server-test",
"progress": 0,
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-03-29T19:52:16Z",
"user_id": "fake"
}
}
Loading

0 comments on commit 6adc8c4

Please sign in to comment.