LIR Management

Get

URL/api/v1/api.php?target=lir&action=get
DescriptionReturns a list of LIRs
Returns

Examples:

SUCCESSFUL
{
    "success": 1,
    "message": "2 objects found",
    "data": [
        {
            "id": "100",
            "name": "RIPE Test LIR",
            "slug": "ripe-test-lir",
            "entities": [
                {
                    "mnt_by": "mntner@email.com"
                    "mnt_by_password": "password",
                    "admin_c": "test-admin-c",
                    "tech_c": "test-tech-c",
                    "api_key": null
                }
            ],
            "rir": "RIPE"
        },
        {
            "id": "101",
            "name": "ARIN Test LIR",
            "slug": "arin-test-lir",
            "entities": [
                {
                    "org_handle": "TEST-10",
                    "admin_poc": "TEST-ARIN",
                    "net_poc": "TEST-ARIN",
                    "abuse_poc": "",
                    "net_name_prefix": "PRFX",
                    "api_key": "API-XXXX-YYYY-ZZZZ-1234"
                }
            ],
            "rir": "ARIN",
            "asn": "1000"
        }
    ]
}
					
ERROR
{
    "success":0,
    "message":"error message"
}
                
Example URL/api/v1/api.php?target=lir&action=get

Delete

URL/api/v1/api.php?target=lir&action=delete&id=﹤ID﹥
DescriptionDeletes an LIR
Returns

Examples:

SUCCESSFUL
{
    "success": 1,
    "message": "LIR deleted."
}
					
ERROR
{
    "success":0,
    "message":"error message"
}
				
Example URL/api/v1/api.php?target=lir&action=delete&id=100

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[ ] =)

Name
Type
Example
Notes
meta[name]STRINGTestLIRName of the new LIR resource.
meta[type]STRINGentryType of resource - Adding a LIR will always be "entry".
meta[section]STRINGlirSection 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[ ][] =)

Name
Type
Example
Notes
fields[rir][]STRINGARINThe RIR for the LIR. Accepted values are "ARIN", "RIPE", "LACNIC", "AfriNIC", "APNIC", and "1918".
fields[asn][]STRING20202The ASN (Autonomous System Number) for the LIR.

Optional Parameters

( fields[ ][] =)

For LIRs with RIR = "ARIN":
Name
Type
Example
Notes
fields[org-handle][]       STRINGorg1

Organization Handle.

NOTE: When providing field information, Organization handle is required in order for the remaining fields to populate.

fields[admin-poc][]STRINGadmin1The admin point of contact object name.
fields[net-poc][]STRINGtech1The network point of contact for this object.
fields[abuse-poc][]STRINGabuse1The abuse point of contact object name.
fields[net-name-prefix][]STRINGtest-The network name prefix.
fields[api-key][]STRINGakakakakakakaAPI key used to interface with RIR services



For LIRs with RIR = "RIPE", "LACNIC", "AfriNIC", "APNIC", and "1918". :
Name
Type
Example
Notes
fields[mnt-by][]STRINGmaint1

The name of the maintainer object.

NOTE: When providing field information, Maintainer name is required in order for the remaining fields to populate.

fields[mnt-by-password][]STRINGpasswordabcdThe maintainer password.
fields[admin-c][]STRINGadmin1Administrative contact for this object.
fields[tech-c][]STRINGtech1Technical 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

Update

URL/api/v1/api.php?target=lir&action=update
Description

Updates a LIR.

LIR updates utilize the Resource system - see API Module - Resource - Update for details on editing a resource via the API.

Returns

Examples:

SUCCESSFUL
{
 "success":1,
 "message":"Resource Updated",
 "data":
 {
 "id":"206",
 "name":"TestName",
 "slug":"dstl-reserved",
 "type":"entry",
 "parent_id":"191",
 "category_id":null,
 "date":1470755920,
 "modified":1517513903,
 "attr":
 {
 "mnt-by-password":11,
 "rir":"RIPE",
 "asn":"30303",
 "mnt-by":"Maint2",
 "admin-c":"admin4",
 "tech-c":"Tech5",
 "_section":"162",
 "_custom_id":"",
 "_gadget_data":[]
 },
 "section":
 {
 "id":"162",
 "name":"4BCH",
 "slug":"4bch",
 "type":"section",
 "parent_id":"1",
 "category_id":null,
 "date":1468356788,
 "modified":1468356788,
 "attr":[]
 },
 "gadgets":[]
 }
}

					
ERROR
{
    "success":0,
    "message":"error message"
}
				

Required Parameters

( meta[ ] =)

Name
Type
Example
Notes
meta[id]INTEGER1234ID of the LIR resource to update.
meta[type]STRINGentryType of resource - Updating a LIR will always be "entry".

Optional Parameters

( meta[ ] =)

Name
Type
Example
Notes
meta[name]STRINGTestLIRName of the LIR resource.


Required Parameters

( fields[ ][] =)


None.



Optional Parameters

( fields[ ][] =)

For LIRs with RIR = "ARIN":
Name
Type
Example
Notes
fields[rir][]STRINGARINThe RIR for the LIR. Accepted values are "ARIN", "RIPE", "LACNIC", "AfriNIC", "APNIC", and "1918".
fields[asn][]STRING20202The ASN (Autonomous System Number) for the LIR.
fields[org-handle][]       STRINGorg1

Organization Handle.

NOTE: When providing field information, Organization handle is required in order for the remaining Org. object fields to populate.

fields[admin-poc][]STRINGadmin1The admin point of contact object name.
fields[net-poc][]STRINGtech1The network point of contact for this object.
fields[abuse-poc][]STRINGabuse1The abuse point of contact object name.
fields[net-name-prefix][]STRINGtest-The network name prefix.
fields[api-key][]STRINGakakakakakakaAPI key used to interface with RIR services



For LIRs with RIR = "RIPE", "LACNIC", "AfriNIC", "APNIC", and "1918". :
Name
Type
Example
Notes
fields[rir][]STRINGRIPEThe RIR for the LIR. Accepted values are "ARIN", "RIPE", "LACNIC", "AfriNIC", "APNIC", and "1918".
fields[asn][]STRING20202The ASN (Autonomous System Number) for the LIR.
fields[mnt-by][]STRINGmaint1

The name of the maintainer object.

NOTE: When providing field information, Maintainer name is required in order for the remaining maintainer object fields to populate.

fields[mnt-by-password][]STRINGpasswordabcdThe maintainer password.
fields[admin-c][]STRINGadmin1Administrative contact for this object.
fields[tech-c][]STRINGtech1Technical contact for this object
Example URL

Update example with only the minimum required information:

This sends only the meta data required for a success response, but it does not actually change any values.

/api/v1/api.php?target=lir&action=update&meta[id]=14068&meta[type]=entry


Update example with changing RIR, ASN, and updating all field information:

This example changes a non-ARIN LIR to an ARIN LIR, and provides all updated information for the new RIR type.

/api/v1/api.php?target=lir&action=update&meta[id]=14068&meta[type]=entry&meta[name]=TestLIR4b&fields[rir][]=ARIN&fields[asn][]=30303&fields[org-handle][]=OrgABC&fields[admin-poc][]=AdminABC&fields[tech-c][]=TechABC&fields[abuse-poc][]=AbuseABC&fields[net-name-prefix][]=TestABC-&fields[api-key][]=abcdabcd

  • No labels