Add |
---|
URL | /api/v1/api.php?target=lir&action=add |
Description | Adds a new LIR. LIR creation utilizes the Resource system - see API Module - Resource - Add for details on adding a resource via the API. |
Returns | Examples: SUCCESSFUL | {
"success":1, "message":"Resource added", "data": { "id":14063, "name":"TestLIR", "slug":"testlir", "type":"entry", "parent_id":1, "category_id":null, "date":1517513319, "modified":1517513319, "attr": { "_section":"94", "rir":"ARIN", "asn":"20202", "org-handle":"org1", "admin-poc":"admin1", "net-poc":"tech1", "abuse-poc":"abuse1", "net-name-prefix":"test-", "api-key":10, "mnt-by":"", "admin-c":"", "tech-c":"", "_gadget_data":false }, "section": { "id":"94", "name":"LIR", "slug":"lir", "type":"section", "parent_id":"1", "category_id":null, "date":1375846025, "modified":1375846025, "attr":[] }, "gadgets":false } }
| ERROR | {
"success":0,
"message":"error message"
}
|
|
Required Parameters ( meta[ ] =) | | | Example | |
---|
meta[name] | STRING | TestLIR | Name of the new LIR resource. | meta[type] | STRING | entry | Type of resource - Adding a LIR will always be "entry". | meta[section] | STRING | lir | Section of the resource object. - Adding a LIR will always have "lir" as the section. |
|
Fields Information | Detail on the "fields" array: |
---|
fields[] | ARRAY | Entry field values (for fields that have already been assigned to the section) can be populated when the entry is created. The format is field[field-slug][field-instance]. If the field instance is left blank, it will simply be the next value in the instance array. For example: fields[network-fqdn][]=example.com&fields[network-fqdn][]=test.com would be written in JSON as var fields = { "network-fqdn": [ "example.com", "test.com" ] } Please note that the Field Slug might differ from the Field Name! To find the correct slug to use in adding resources with field values go the Section of the Resource you are adding, click 'Edit', then click the name of the Fields you will be populating. An Edit Field box will pop up which displays the Field's slug. A field can be added to a section multiple times. The field instance is used to keep track of which field occurrence we are referring. In this example, the network-fqdn field had been added twice to the section so we were able to store two values for it. |
|
Required Parameters ( fields[ ][] =) | | | Example | |
---|
fields[rir][] | STRING | ARIN | The RIR for the LIR. Accepted values are "ARIN", "RIPE", "LACNIC", "AfriNIC", "APNIC", and "1918". | fields[asn][] | STRING | 20202 | The ASN (Autonomous System Number) for the LIR. |
|
Optional Parameters ( fields[ ][] =) | For LIRs with RIR = "ARIN": | | | Example | |
---|
fields[org-handle][] | STRING | org1 | Organization Handle | fields[admin-poc][] | STRING | admin1 | The admin point of contact object name. | fields[technet-cpoc][] | STRING | tech1 | Technical The network point of contact for this object. | fields[abuse-poc][] | STRING | abuse1 | The abuse point of contact object name. | fields[net-name-prefix][] | STRING | test- | The network name prefix. | fields[api-key][] | STRING | akakakakakaka | API key used to interface with RIR services |
For LIRs with RIR = "RIPE", "LACNIC", "AfriNIC", "APNIC", and "1918". : | | | Example | |
---|
fields[mnt-by][] | STRING | maint1 | The name of the maintainer object. | fields[mnt-by-password][] | STRING | passwordabcd | The maintainer password. | fields[admin-c][] | STRING | admin1 | Administrative contact for this object. | fields[tech-c][] | STRING | tech1 | Technical contact for this object |
|
Example URL | ARIN example with only minimum required information: /api/v1/api.php?target=lir&action=add&meta[name]=TestLIR1&meta[type]=entry&meta[section]=lir&fields[rir][]=ARIN&fields[asn][]=20202 ARIN example with full Organization field details: /api/v1/api.php?target=lir&action=add&meta[name]=TestLIR2&meta[type]=entry&meta[section]=lir&fields[rir][]=ARIN&fields[asn][]=20202&fields[org-handle][]=org1&fields[admin-poc][]=admin1&fields[net-poc][]=tech1&fields[abuse-poc][]=abuse1&fields[net-name-prefix][]=test-&fields[api-key][]=akakakakakaka Non-ARIN example with only minimum required information: /api/v1/api.php?target=lir&action=add&meta[name]=TestLIR3&meta[type]=entry&meta[section]=lir&fields[rir][]=RIPE&fields[asn][]=20202 Non-ARIN example with full Organization field details: /api/v1/api.php?target=lir&action=add&meta[name]=TestLIR4&meta[type]=entry&meta[section]=lir&fields[rir][]=1918&fields[asn][]=20202&fields[mnt-by][]=maint1&fields[mnt-by-password][]=passwordabcd&fields[admin-c][]=admin1&fields[tech-c][]=tech1 |