Create Firewall Group

(Difference between revisions)
Jump to: navigation, search
Administrator (Talk | contribs)
(Created page with "A Security Group defines firewall rules for your Server. You have the ability to configure your firewall connections and secure your network as required. You may have one or m...")
Newer edit →

Revision as of 15:31, 4 July 2012

A Security Group defines firewall rules for your Server. You have the ability to configure your firewall connections and secure your network as required. You may have one or multiple servers behind a firewall group. Hostway provides a default firewall group, and typical firewall rules are already configured. You can create multiple firewall groups as needed.

Contents

POST /os-security-groups

This operation will create a new firewall group.

Request

JSON

 {
    "security_group" : {
       "display_name" : "{firewall_group_display_name}", 
       "description" : "{firewall_group_description}"
    }
 }

security_group

display_name - string
Display name for this firewall group.
description - string
Descriptive information for this firewall group.

Response

JSON

{
   "security_group" : {
      "display_name": "{firewall_group_display_name}", 
      "description": "{firewall_group_description}", 
      "links": [
         {
            "href": "http://{api_server}/os-security-groups/{firewall_group_name}/", 
            "rel": "self"
         }
      ], 
      "rules": [], 
      "name": "{firewall_group_name}", 
      "account_number": "{user_account_number}", 
      "servers": []
   }
}

security_group

display_name - string
Display name for this firewall group.
description - string
Descriptive information for this firewall group.
links - list
Hypermedia for this resource.
rules - list
List of all defined security rules for the group.
name - string
The name of the firewall group.*(Unique identifier for this firewall group.)
account_number - string
The account number this firewall group resource belongs to.
servers - list
List of server IDs this security group is assigned to.

Response Codes

Success
HTTP/1.1 201 Created
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 the wrong credentials (e.g., bad password), or your browser does not understand how to supply the credentials required.

Examples

Successfully create a new firewall group

POST http(s)://{api_server}/os-security-groups

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Request Body:

 {
    "security_group" : {
       "display_name" : "Test Firewall Group", 
       "description" : "Test firewall group description." 
    }
 }
 

Response Code:

HTTP/1.1 201 Created

Response Body:

 {
    "security_group" : {
       "display_name": "Test Firewall Group", 
       "description": "Test firewall group description.", 
       "links": [
          {
             "href": "http://{api_server}/os-security-groups/group2012May11_OK30Zs7Ju/", 
             "rel": "self"
          }
       ], 
       "rules": [], 
       "name": "group2012May11_OK30Zs7Ju", 
       "account_number": "test_account_120761",
       "servers": []
    }
 }

Failure while trying to create a new firewall group with invalid data

POST http(s)://{api_server}/os-security-groups

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Request Body:

{
   Empty
}

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

 {
    "badRequest" : {
       "message": "Invalid", 
       "code": 400, 
       "details": ""
    }
 }

Failure while trying to create a new firewall group with an already existing firewall group display name

POST http(s)://{api_server}/os-security-groups

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded username & password string

Request Body:

 {
    "security_group" : {
       "display_name" : "Test Firewall Group",
       "description" : "Test firewall group description."
    }
 }

Response Code:

HTTP/1.1 400 Bad Request

Response Body:

 {
    "computeFault" : {
       "message": "GroupNameError", 
       "code": 400, 
       "details": "Display name in use"
    }
 }

Failure while trying to make unauthorized access

POST http(s)://{api_server}/os-security-groups

Request Headers:

   Content-Type:application/json
   Charset=UTF-8
   Authorization:Base64-encoded fake_authentication_string

Response Code:

HTTP/1.1 401 Unauthorized

Response Body:

    401 Unauthorized
    This server could not verify that you are authorized to
    access the document you requested.  Either you supplied the
    wrong credentials (e.g., bad password), or your browser
    does not understand how to supply the credentials required.


blog comments powered by Disqus


Personal tools
Namespaces
Variants
Actions
APIs
Navigation
Toolbox