AssignSecurityGroupToServer
From Hostway API Documentation
(Difference between revisions)
Mike.robski (Talk | contribs) m (1 revision: Release 86) |
Mike.robski (Talk | contribs) m (1 revision: Release 109) |
||
(One intermediate revision by one user not shown) | |||
Line 16: | Line 16: | ||
{ | { | ||
"securityGroup" : { | "securityGroup" : { | ||
− | "id" : "{security_group_id}" | + | "id": "{security_group_id}", |
+ | "status": "{status}" | ||
} | } | ||
}</nowiki> | }</nowiki> | ||
Line 22: | Line 23: | ||
; securityGroup.id - ''string'' | ; securityGroup.id - ''string'' | ||
: The unique name of the securityGroup. | : The unique name of the securityGroup. | ||
+ | |||
+ | ; status - ''string'' | ||
+ | : Status. Only enabled is supported currently | ||
== Response Codes == | == Response Codes == | ||
Line 43: | Line 47: | ||
{ | { | ||
"securityGroup" : { | "securityGroup" : { | ||
− | "id" : "group2012Nov02_jD6NX8BsK" | + | "id": "group2012Nov02_jD6NX8BsK" |
+ | "status": "enabled" | ||
} | } | ||
}</nowiki> | }</nowiki> | ||
Line 54: | Line 59: | ||
{ | { | ||
"securityGroup" : { | "securityGroup" : { | ||
− | "id" : "2012May08_61EfdIZ3Y" | + | "id": "2012May08_61EfdIZ3Y" |
"links": [{"href": "http://{api_server}/accounts/{accountId}/flexcloud/os-security-groups/group2012Nov02_jD6NX8BsK/", "rel": "self"}] | "links": [{"href": "http://{api_server}/accounts/{accountId}/flexcloud/os-security-groups/group2012Nov02_jD6NX8BsK/", "rel": "self"}] | ||
} | } | ||
Line 70: | Line 75: | ||
{ | { | ||
"securityGroup" : { | "securityGroup" : { | ||
− | "id" : "not_exist" | + | "id": "not_exist", |
+ | "status": "enabled" | ||
} | } | ||
}</nowiki> | }</nowiki> |
Latest revision as of 12:12, 24 July 2015
This operation will assign a securityGroup to the specified server
Contents |
PUT /accounts/{accountId}/flexcloud/servers/{id}/os-security-group
Parameters
- accountId - string
- The selected account Id.
- id
- The unique identifier of the server.
Request
JSON
{ "securityGroup" : { "id": "{security_group_id}", "status": "{status}" } }
- securityGroup.id - string
- The unique name of the securityGroup.
- status - string
- Status. Only enabled is supported currently
Response Codes
- Success
- HTTP/1.1 200 OK
- Failure
- HTTP/1.1 400 Bad Request
- HTTP/1.1 401 Unauthorized : This server could not verify that you are authorized to access the document you requested. Either you supplied incorrect credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.
Examples
Successfully assign a securityGroup to the specified server
- PUT http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/test_server_0013/os-security-group
Request Headers:
Content-Type:application/json Charset=UTF-8 Authorization:Base64-encoded username & password string
Request Body:
{ "securityGroup" : { "id": "group2012Nov02_jD6NX8BsK" "status": "enabled" } }
Response Code:
HTTP/1.1 200 OK
Response Body:
{ "securityGroup" : { "id": "2012May08_61EfdIZ3Y" "links": [{"href": "http://{api_server}/accounts/{accountId}/flexcloud/os-security-groups/group2012Nov02_jD6NX8BsK/", "rel": "self"}] } }
Failure while trying to assign a firewall group to server
- PUT http(s)://{api_server}/accounts/{accountId}/flexcloud/servers/test_server_0013/os-security-group
Request Headers:
Content-Type:application/json Charset=UTF-8 Authorization:Base64-encoded username & password string
{ "securityGroup" : { "id": "not_exist", "status": "enabled" } }
Response Code:
HTTP/1.1 400 Bad Request