REST Operations (Single object)

Create an object of type “Scope” and name “AutomationTestScope”

Request URL: /web-services/rest/resource/Scope

XML: ContentType: application/xml
<Scope>
   <name>acl1</name>
</Scope>


JSON: ContentType: application/json
{ 
   "name":" AutomationTestScope"
} 

Retrieve an object of type ‘Scope’ and name ‘AutomationTestScope’

Request Url: /web-services/rest/resource/Scope/AutomationTestScope

<Scope>
   <objectOid>OID-00:00:00:00:00:00:06:c0</objectOid>
   <name> AutomationTestScope </name>
   <tenantId>0</tenantId>
</Scope>

Modifying an Object

PUT: Used to update/modify the attributes of an existing object (if not found, new object will be created.)

XML: ContentType: application/xml
<Scope>
   <name>AutomationTestScope</name>
   <description>Edited Through Automation</description>
</Scope>
JSON: ContentType: application/json
{ 
   "name":"AutomatedscopeJson1",
   "description":"Edited Through Automation"
} 

Deleting an Object

Request Url: /web-services/rest/resource/Scope/AutomationTestScope

Content:
<Scope>
   <objectOid>OID-00:00:00:00:00:00:06:c0</objectOid>
   <name>AutomationTestScope</name>
   <tenantId>0</tenantId>
</Scope>

REST Operations (List of objects)

Ex: Create a list of type “Scope” and name “AutomationTestScope1”, “AutomationTestScope2”, “AutomationTestScope3”


XML: ContentType: application/xml
<classBases>
   <Scope>
      <name>AutomationScope1</name>
      <policy>default</policy>
      <rangeList>
         <RangeItem>
            <end>30.0.0.10</end>
            <start>30.0.0.2</start>
         </RangeItem>
      </rangeList>
      <subnet>30.0.0.0/24</subnet>
      <tenantId>0</tenantId>
      <vpnId>0</vpnId>
   </Scope>
   <Scope>
      <name>AutomationScope2</name>
      <subnet>2.0.0.0/24</subnet>
   </Scope>
   <Scope>
      <name>AutomationScope3</name>
      <subnet>3.0.0.0/24</subnet>
   </Scope>
</classBases> 
JSON: ContentType: application/json
 [ 
   { 
      "name":"AutomationScope1",
      "policy":"default",
      "rangeList":{ 
         "RangeItem":{ 
            "end":"40.0.0.10",
            "start":"40.0.0.2"
         }
      },
      "subnet":"40.0.0.0/24",
      "tenantId":"0",
      "vpnId":"0"
   },
   { 
      "name":"AutomationScope2",
      "subnet":"5.0.0.0/24"
   },
   { 
      "name":"AutomationScope3",
      "subnet":"6.0.0.0/24"
   }
]

Getting a list of objects

GET: used to retrieve a list of objects of the specified type (Ex: name)

Request Url:

/web-services/rest/resource/Scope/

<classBases>
   <Scope>
      <objectOid>OID-00:00:00:00:00:00:06:c2</objectOid>
      <name>AutomatedscopeXml1</name>
      <policy>default</policy>
      <rangeList>
         <RangeItem>
            <end>30.0.0.10</end>
            <start>30.0.0.2</start>
         </RangeItem>
      </rangeList>
      <subnet>30.0.0.0/24</subnet>
      <tenantId>0</tenantId>
      <vpnId>0</vpnId>
   </Scope>
   <Scope>
      <objectOid>OID-00:00:00:00:00:00:06:c3</objectOid>
      <name>AutomatedscopeXml2</name>
      <policy>default</policy>
      <subnet>2.0.0.0/24</subnet>
      <tenantId>0</tenantId>
      <vpnId>0</vpnId>
   </Scope>
   <Scope>
      <objectOid>OID-00:00:00:00:00:00:06:c4</objectOid>
      <name>AutomatedscopeXml3</name>
      <policy>default</policy>
      <subnet>3.0.0.0/24</subnet>
      <tenantId>0</tenantId>
      <vpnId>0</vpnId>
   </Scope>
</classBases>