Add add/remove SecurityGroup in Compute API

1. Add addSecurityGroup and removeSecurityGroup to
   Servers actions section.

Change-Id: I06ffa9718818b445dbac818cf7231f2c5689396d
Closes-Bug: #1524199
This commit is contained in:
Duncan.C
2016-01-18 14:38:59 +08:00
parent 3da50c20cc
commit 9b3d0bacd1
5 changed files with 127 additions and 14 deletions

View File

@@ -193,7 +193,8 @@
You can lock, pause, reboot, rebuild, rescue, resize, resume, confirm
the resize of, revert a pending resize for, shelve, shelf-offload,
unshelve, start, stop, unlock, unpause, and unrescue a server. You can
also change the password of the server.
also change the password of the server and add a security group to or
remove a security group from a server.
</para>
<para>
You can get an RDP, serial, SPICE, or VNC console for a server.
@@ -262,6 +263,10 @@
<wadl:resource href="../wadls/compute-api/src/v2.1/wadl/servers-action-shelve-v2.1.wadl#action">
<wadl:method href="#unshelve"/>
</wadl:resource>
<wadl:resource href="../wadls/compute-api/src/v2.1/wadl/servers-action-v2.1.wadl#action">
<wadl:method href="#addSecurityGroup"/>
<wadl:method href="#removeSecurityGroup"/>
</wadl:resource>
</wadl:resources>
</section>
<section xml:id="os-admin-actions-v2.1">

View File

@@ -3309,6 +3309,46 @@
</para>
</wadl:doc>
</param>'>
<!ENTITY security-group-nameRequestParameter '
<param xmlns="http://wadl.dev.java.net/2009/02"
name="name" style="plain" required="true"
type="xsd:string">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xmlns:wadl="http://wadl.dev.java.net/2009/02"
xml:lang="EN">
<para>
The security group name.
</para>
</wadl:doc>
</param>'>
<!ENTITY addSecurityGroupActionRequestParameter '
<param xmlns="http://wadl.dev.java.net/2009/02"
name="addSecurityGroup" style="plain" required="true"
type="xsd:string">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xmlns:wadl="http://wadl.dev.java.net/2009/02"
xml:lang="EN">
<para>
The action.
</para>
</wadl:doc>
</param>
&security-group-nameRequestParameter;
'>
<!ENTITY removeSecurityGroupActionRequestParameter '
<param xmlns="http://wadl.dev.java.net/2009/02"
name="removeSecurityGroup" style="plain" required="true"
type="xsd:string">
<wadl:doc xmlns="http://docbook.org/ns/docbook"
xmlns:wadl="http://wadl.dev.java.net/2009/02"
xml:lang="EN">
<para>
The action.
</para>
</wadl:doc>
</param>
&security-group-nameRequestParameter;
'>
<!ENTITY serverResponseParameters '
&serverAddressResponseParameters;
&createdResponseParameter;

View File

@@ -0,0 +1,5 @@
{
"addSecurityGroup": {
"name": "default"
}
}

View File

@@ -0,0 +1,5 @@
{
"removeSecurityGroup": {
"name": "default"
}
}

View File

@@ -22,6 +22,7 @@
&server_idTemplateParameter;
<resource id="action" path="action">
<method href="#addFloatingIp"/>
<method href="#addSecurityGroup"/>
<method href="#attach"/>
<method href="#changePassword"/>
<method href="#confirmResize"/>
@@ -31,6 +32,7 @@
<method href="#reboot"/>
<method href="#rebuild"/>
<method href="#removeFloatingIp"/>
<method href="#removeSecurityGroup"/>
<method href="#rescue"/>
<method href="#resize"/>
<method href="#resume"/>
@@ -231,8 +233,8 @@
Confirms a pending resize action for a server.
</para>
<para>
Specify the
<code>confirmResize</code> action in the request body.
Specify the <code>confirmResize</code> action in the request
body.
</para>
<para>
After you make this request, you typically must keep
@@ -370,8 +372,10 @@
<method name="POST" id="pause">
<wadl:doc xml:lang="EN" title="Pause server (pause action)"
xmlns="http://docbook.org/ns/docbook">
<para role="shortdesc">Pauses a server. Changes its status
to <code>PAUSED</code>.</para>
<para role="shortdesc">
Pauses a server. Changes its status
to <code>PAUSED</code>.
</para>
<para>
Specify the <code>pause</code> action in the request body.
</para>
@@ -512,7 +516,8 @@
&commonFaults; &getFaults; &postPutFaults;
&rebootFaults; &inProgressFault; </method>
<method name="POST" id="rebuild">
<wadl:doc xmlns="http://docbook.org/ns/docbook" xml:lang="EN" title="Rebuild server (rebuild action)">
<wadl:doc xmlns="http://docbook.org/ns/docbook" xml:lang="EN"
title="Rebuild server (rebuild action)">
<para role="shortdesc">
Rebuilds a server.
</para>
@@ -837,7 +842,9 @@
<method name="POST" id="unlock">
<wadl:doc xml:lang="EN" title="Unlock server (unlock action)"
xmlns="http://docbook.org/ns/docbook">
<para role="shortdesc">Unlocks a server.</para>
<para role="shortdesc">
Unlocks a locked server.
</para>
<para>
Specify the <code>unlock</code> action in the request body.
</para>
@@ -895,12 +902,10 @@
<wadl:doc xmlns="http://docbook.org/ns/docbook" xml:lang="EN"
title="Unrescue server (unrescue action)">
<para role="shortdesc">
Unrescues a server. Changes status to
<code>ACTIVE</code>.
Unrescues a server. Changes status to <code>ACTIVE</code>.
</para>
<para>
Specify the <code>unrescue</code>
action in the request body.
Specify the <code>unrescue</code> action in the request body.
</para>
<para>Preconditions</para>
<itemizedlist>
@@ -915,7 +920,8 @@
After you successfully unrescue a server and make a
<code>GET
/v2.1/{tenant_id}/servers/{server_id}</code>
request, its status changes to <code>ACTIVE</code>.</para>
request, its status changes to <code>ACTIVE</code>.
</para>
</listitem>
</itemizedlist>
</wadl:doc>
@@ -933,4 +939,56 @@
</request>
<response status="202"/>
</method>
<method name="POST" id="addSecurityGroup">
<wadl:doc xml:lang="EN" title="Add security group to a server (addSecurityGroup action)"
xmlns="http://docbook.org/ns/docbook">
<para role="shortdesc">
Adds a security group to a server.
</para>
<para>
Specify the <code>addSecurityGroup</code> action in the request body.
</para>
</wadl:doc>
<request>
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="../samples/servers-action-admin/addSecurityGroup-request.json"
/>
</wadl:doc>
&addSecurityGroupActionRequestParameter;
</representation>
</request>
<response status="202"/>
&commonFaults;
&postPutFaults;
</method>
<method name="POST" id="removeSecurityGroup">
<wadl:doc xml:lang="EN"
title="Remove security group from a server (removeSecurityGroup action)"
xmlns="http://docbook.org/ns/docbook">
<para role="shortdesc">
Removes a security group from a server.
</para>
<para>
Specify the <code>removeSecurityGroup</code> action in the
request body.
</para>
</wadl:doc>
<request>
<representation mediaType="application/json">
<wadl:doc xml:lang="EN"
xmlns="http://docbook.org/ns/docbook">
<xsdxt:code
href="../samples/servers-action-admin/removeSecurityGroup-request.json"
/>
</wadl:doc>
&removeSecurityGroupActionRequestParameter;
</representation>
</request>
<response status="202"/>
&commonFaults;
&postPutFaults;
</method>
</application>