Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

delete

URL/api/v1/api.php?target=resource&action=delete
DescriptionDelete a resource.
ReturnsExamples:
SUCCESSFUL: {"success":1,"message":"Resource deleted."}
ERROR: {"success":0,"message":"No resource found with ID: 57"}
Required Parameters
NameTypeNotes/Example
idINTEGERID of the resource
Optional Parameters
NameTypeNotes/Example
recursiveBOOLWhen 1, deletes parent and child entries for the resource

A recursive delete will delete all resources, which are permitted to be deleted, from the bottom up.

Imagine the following hierarchy:

Code Block
             A
    B1                B2
C11    C12        C21    C22

If a recursive delete is performed on A, but C21 is not deletable, the following

resources would still be deleted: (B1, C11, C12, C22).

B2 would not be deleted because it depends on C21 and A would not be deleted because it depends on B2.

 

Example URL/api/v1/api.php?target=resource&action=delete&id=57
Description

Get available resource links. If no resource links exist for the given resource, an empty object is returned.

URL/api/v1/api.php?target=resource&action=getLink
Returns

Examples:

SUCCESSFUL:{"success":1 ,"message":"Search successful", "data":{"meta":{"totalRecords":"3", "retrieved":3}, "0":{"id":"22", "resource_id1":"1292", "resource_id2":"1302", "relation":"dhcpPoolLink"}, "1":{"id":"2", "resource_id1":"1292", "resource_id2":"1452", "relation":"dhcpPoolLink"}, "2":{"id":"12", "resource_id1":"1422", "resource_id2":"1482", "relation":"dhcpPoolLink"}}}
ERROR:{"success":0, "message":"error message"}

Return Detail:

NameTypeDescription
idINTEGERId of the resource linkage
resource_id1INTEGERThe id of the parent resource
resource_id2INTEGERThe id of the linked resource
relationSTRINGThe relation type. Relation types include:
contact, dhcpPoolLink, dnsViewACL, dnsViewServer, dnsZoneMaster, dnsZoneServer, dnsZoneView 

Meta Attributes:

NameTypeDescription
totalRecordsINTEGERHow many records were found by this query, without pagination.
retrievedINTEGERHow many records were returned by this query, with pagination.

Optional Attributes:

NameTypeDescription
resultsPerPageINTEGERHow many records to include per page display.*
pageINTEGERWhich page to display, when used with "resultsPerPage"*
*Example pagination: api.php?target=resource&action=getLink&relation=dhcpPoolLink&resultsPerPage=100&page=2