UWAGA: poniższa dokumentacja dotyczy nieakutalnej wersji API (2.0.0). Kliknij aby przejść do aktualnej dokumentacji.

<<

NAME

Service - Manage your services.

FORMAL SPECIFICATION

WSDL: https://api.cloudmonit.pl/2.0.0/wsdl/Service.wsdl

JSON: https://api.cloudmonit.pl/2.0.0/json/Service.json

DESCRIPTION

This module provides methods to manage your services and retrieve information about them.

It's interface conforms to the standard CRUD scheme.

SYNOPSIS

POST the JSONs to https://api.cloudmonit.pl/2.0.0/json_api.

See the README for more information.

        ############### create a http service (type_id = 1) ##############
        
        {                                                               {
           "auth" : {                                                      "auth" : {},
              "login" : "LOGIN",                                           "data" : {
              "password" : "PASSWORD"                                         "id" : 279370
           },                                                              },
           "data" : {                                                      "error" : null,
              "interval" : 600,                                            "version" : "2.0.0"
              "name" : "Google",                                        }
              "type_id" : 1,                                            
              "url" : "google.com"                                      
           },                                                           
           "method" : "Create",                                         
           "module" : "Service"                                         
        }                                                               
        
        
        ############### create a paused http service on port 8000 ##############
        
        {                                                               {
           "auth" : {                                                      "auth" : {},
              "login" : "LOGIN",                                           "data" : {
              "password" : "PASSWORD"                                         "id" : 279371
           },                                                              },
           "data" : {                                                      "error" : null,
              "features" : [                                               "version" : "2.0.0"
                 {                                                      }
                    "id" : "port",                                      
                    "value" : "8000"                                    
                 }                                                      
              ],                                                        
              "interval" : 300,                                         
              "name" : "My server",                                     
              "pause" : 1,                                              
              "type_id" : 1,                                            
              "url" : "my_http_server.com"                              
           },                                                           
           "method" : "Create",                                         
           "module" : "Service"                                         
        }                                                               
        
        
        ############### list all services ##############
        
        {                                                               {
           "auth" : {                                                      "auth" : {},
              "login" : "LOGIN",                                           "data" : {
              "password" : "PASSWORD"                                         "elements" : [
           },                                                                    {
           "method" : "Find",                                                       "avg_response_time" : 279173,
           "module" : "Service"                                                     "description" : null,
        }                                                                           "error" : 0,
                                                                                    "group_id" : 150507194,
                                                                                    "id" : 279370,
                                                                                    "interval" : 600,
                                                                                    "last_invalid_check" : null,
                                                                                    "last_valid_check" : 138027091.51069,
                                                                                    "name" : "Google",
                                                                                    "pause" : 0,
                                                                                    "silent_mode" : 0,
                                                                                    "suspension" : 0,
                                                                                    "type_id" : 1,
                                                                                    "type_name" : "http",
                                                                                    "url" : "google.com"
                                                                                 },
                                                                                 {
                                                                                    "avg_response_time" : null,
                                                                                    "description" : null,
                                                                                    "error" : null,
                                                                                    "group_id" : 150507194,
                                                                                    "id" : 279371,
                                                                                    "interval" : 300,
                                                                                    "last_invalid_check" : null,
                                                                                    "last_valid_check" : null,
                                                                                    "name" : "My server",
                                                                                    "pause" : 1,
                                                                                    "silent_mode" : 0,
                                                                                    "suspension" : 0,
                                                                                    "type_id" : 1,
                                                                                    "type_name" : "http",
                                                                                    "url" : "my_http_server.com"
                                                                                 }
                                                                              ],
                                                                              "total" : 2
                                                                           },
                                                                           "error" : null,
                                                                           "version" : "2.0.0"
                                                                        }
        
        
        ############### get a service with it's features ##############
        
        {                                                               {
           "auth" : {                                                      "auth" : {},
              "login" : "LOGIN",                                           "data" : {
              "password" : "PASSWORD"                                         "avg_response_time" : 278165.5,
           },                                                                 "description" : null,
           "data" : {                                                         "error" : 0,
              "id" : 279370,                                                  "features" : [
              "with" : [                                                         {
                 "features"                                                         "id" : "port",
              ]                                                                     "value" : "80"
           },                                                                    },
           "method" : "Read",                                                    {
           "module" : "Service"                                                     "id" : "timeout",
        }                                                                           "value" : "7000"
                                                                                 },
                                                                                 {
                                                                                    "id" : "http_method",
                                                                                    "value" : "HEAD"
                                                                                 },
                                                                                 {
                                                                                    "id" : "error_tolerance",
                                                                                    "value" : "51"
                                                                                 },
                                                                                 {
                                                                                    "id" : "locations_failover_enabled",
                                                                                    "value" : "1"
                                                                                 },
                                                                                 {
                                                                                    "id" : "content_regexp",
                                                                                    "value" : null
                                                                                 },
                                                                                 {
                                                                                    "id" : "content_type",
                                                                                    "value" : null
                                                                                 },
                                                                                 {
                                                                                    "id" : "content_regexp_not",
                                                                                    "value" : null
                                                                                 },
                                                                                 {
                                                                                    "id" : "content",
                                                                                    "value" : null
                                                                                 }
                                                                              ],
                                                                              "group_id" : 150507194,
                                                                              "id" : 279370,
                                                                              "interval" : 600,
                                                                              "last_invalid_check" : null,
                                                                              "last_valid_check" : 1380271541.49633,
                                                                              "name" : "Google",
                                                                              "pause" : 0,
                                                                              "silent_mode" : 0,
                                                                              "suspension" : 0,
                                                                              "type_id" : 1,
                                                                              "type_name" : "http",
                                                                              "type_prefix" : "http://",
                                                                              "url" : "google.com"
                                                                           },
                                                                           "error" : null,
                                                                           "version" : "2.0.0"
                                                                        }
        
        
        ############### pause the monitoring and add a description ##############
        
        {                                                               {
           "auth" : {                                                      "auth" : {},
              "login" : "LOGIN",                                           "data" : {},
              "password" : "PASSWORD"                                      "error" : null,
           },                                                              "version" : "2.0.0"
           "data" : {                                                   }
              "description" : "Testing if google.com works",            
              "id" : 279370,                                            
              "pause" : 1                                               
           },                                                           
           "method" : "Update",                                         
           "module" : "Service"                                         
        }                                                               
        
        
        ############### delete a service ##############
        
        {                                                               {
           "auth" : {                                                      "auth" : {},
              "login" : "LOGIN",                                           "data" : {},
              "password" : "PASSWORD"                                      "error" : null,
           },                                                              "version" : "2.0.0"
           "data" : {                                                   }
              "id" : 279371                                             
           },                                                           
           "method" : "Delete",                                         
           "module" : "Service"                                         
        }                                                               

METHODS

Create

Creates a new service and returns it's ID.

The only mandatory arguments are type_id, name, interval and url.

You can get a list of available service types with the ServiceType::Find method.

Arguments

Returns

Delete

Permanently deletes a service with all settings and gathered statistics.

Arguments

Returns

Nothing.

Find

This method allows you to fetch information about selected Service objects.

Arguments

Returns

Authorization

This method can be called by read-only users.

Meta

Returns the JSON or WSDL specification of the Service API module.

WARNING

This method is meant for internal usage in API clients. Unless you are writing one, you probably do not need it.

Arguments

Returns

Authorization

This method can be called by read-only users.

Read

Get information about one of your services.

The results may contain different fields depending on the with argument. See each field's description below to find out which with token is required.

Arguments

Returns

Authorization

This method can be called by read-only users.

Update

Changes a service's settings.

A special case is enabling and disabling the monitoring - to do it, change the pause attribute to 1 or 0.

Arguments

Returns

Nothing.

SEE ALSO

<<