Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added GET list example

...

We can manage the Administration Configuration resources below using this API:- http://host/en/omk/admin/api/v2/resource

Resource is our term for items in a configuration file or database.

Our current resource list consists of locations, contacts, services, escalations, events, polling-policy, users, access, customers and businessservices.

The resources can be accessed using the web interface or the API.

API Routes

Each resource has a consistent set of operations

Request Method

id required

Operation

URL Example

id required

Notes

POST
n
create/resourcenInsert a new resource.
GET
y
read
one
list/resource
/id
nReturns
the details of a resource
a list of resources.
GET
n
read
list
one/resource/idyReturns
a list of resources
the details of a resource.
PUT
y
update/resource/idyUpdate the details of a resource.
DELETE
y
delete/resource/idyDelete a resource.


API ResourcesLocationsContactsServicesEscalationsEventsPolling-PolicyUsersAccessCustomersBusinessServices

...

ResourceOperationMethodURLResponseExample
LocationsCreatePOSThttp://host/en/omk/admin/api/v2/locations.json

New Location in NMIS configurations.

http://apollo.opmantek.net:8080/en/omk/admin/api/v2/locations.json

Code Block
{
            "Address1": "",
            "Address2": "",
            "City": "",
            "Country": "",
            "Floor": "",
            "Geocode": "fake geo code",
            "Latitude": "xx.xxxxxxx",
           "Location": "Mandatory param",
           "Longitude": "xx.xxxxxxx",
           "Postcode": "",
           "Room": "",
           "State": "",
           "Suburb": ""
    }


LocationsRead listGEThttp://host/en/omk/admin/api/v2/locations.jsonLocations present in NMIS configuration file.NEED AN EXAMPLE

Code Block
languagejs
[
    {
         Address1: "Eden",
         Address2: "",
         City: "Wellington",
         Country: "New Zealand",
         Floor: "",
         Geocode: "Island Bay, Wellington, New Zealand",
         Latitude: "-41.3372593",
         Location: "Island Bay DC",
         Longitude: "174.7726262",
         Postcode: "",
         Room: "",
         State: "",
         Suburb: "Island Bay",
         _id: "Island Bay DC"
     },
     {
         Address1: "",
         Address2: "",
         City: "",
         Country: "",
         Floor: "",
         Geocode: "Melbourne VIC, Australia",
         Latitude: "-37.8136276",
         Location: "MelbourneDC",
         Longitude: "144.9630576",
         Postcode: "",
         Room: "",
         State: "",
         Suburb: "",
         _id: "MelbourneDC"
    }
]


LocationsRead oneGEThttp://host/en/omk/admin/api/v2/locations/{location-name}.jsonLocations present in NMIS configuration file.

http://apollo.opmantek.net:8080/en/omk/admin/api/v2/locations/Amsterdam.json

Code Block
{
    "Address1": "",
    "Address2": "",
    "City": "",
    "Country": "Netherlands",
    "Floor": "",
    "Geocode": "Amsterdam, Netherlands",
    "Latitude": "52.3675734",
    "Location": "Amsterdam",
    "Longitude": "4.9041389",
    "Postcode": "",
    "Room": "",
    "State": "",
    "Suburb": "",
    "_id": "Amsterdam"
}


LocationsUpdatePUThttp://host/en/omk/admin/api/v2/locations/{location-name}.jsonUpdated location entry

http://apollo.opmantek.net:8080/en/omk/admin/api/v2/locations/Mandatory%20param.json

Code Block
themeFadeToGrey
 {
           "Address1": "42 Main Street",
            "Address2": "",
           "City": "",
           "Country": "",
           "Floor": "",
           "Geocode": "fake geo code",
           "Latitude": "xx.xxxxxxx",
           "Location": "Mandatory param",
           "Longitude": "yy.yyyyyyy",
           "Postcode": "",
            "Room": "",
            "State": "",
           "Suburb": ""
    }


LocationsDeleteDELETEhttp://host/en/omk/admin/api/v2/locations/{location-name}.jsonDeletes the location entry from configurations

http://apollo.opmantek.net:8080/en/omk/admin/api/v2/locations/Mandatory%20param.json

Code Block
{
    "redirect_to": null,
    "success": 1
}


...