Versions Compared

Key

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

...

Panel
GET /ari/asterisk/logging
POST /ari/asterisk/logging/addlogmylog?channel=mylog&levels=debug,verbose,dtmfconfiguration=notice,error,warning
PUT /ari/asterisk/logging/mylog/rotate
DELETE /ari/asterisk/logging/mylog

...

Code Block
titleasterisk.json
"apis": [
	{
		"path": "/asterisk/modules",
		"description": "Asterisk modules",
		"operations": [
			{
				"httpMethod": "GET",
				"summary": "List Asterisk modules.",
				"nickname": "listModules",
				"responseClass": "List[Module]"
			}
		]
	},
	{
		"path": "/asterisk/modules/{moduleName}",
		"description": "Asterisk module",
		"operations": [
			{
				"httpMethod": "GET",
				"summary": "Get Asterisk module information.",
				"nickname": "getModule",
				"responseClass": "Module",
				"parameters": [
					{
						"name": "moduleName",
						"description": "Module's name",
						"paramType": "path",
						"required": true,
						"allowMultiple": false,
						"dataType": "string"
					}
				],
				"errorResponses": [
					{
						"code": 404,
						"reason": "Module could not be found in running modules."
					},
					{
						"code": 409,
						"reason": "Module information could not be retrieved."
					}
				]
			},
			{
				"httpMethod": "POST",
				"summary": "Load an Asterisk module.",
				"nickname": "loadModule",
				"responseClass": "void",
				"parameters": [
					{
						"name": "moduleName",
						"description": "Module's name",
						"paramType": "path",
						"required": true,
						"allowMultiple": false,
						"dataType": "string"
					}
				],
				"errorResponses": [
					{
						"code": 409,
						"reason": "Module could not be loaded."
					}
				]
			},
			{
				"httpMethod": "PUT",
				"summary": "Reload an Asterisk module.",
				"nickname": "reloadModule",
				"responseClass": "void",
				"parameters": [
					{
						"name": "moduleName",
						"description": "Module's name",
						"paramType": "path",
						"required": true,
						"allowMultiple": false,
						"dataType": "string"
					}
				],
				"errorResponses": [
					{
						"code": 404,
						"reason": "Module not found in running modules."
					},
					{
						"code": 409,
						"reason": "Module could not be reloaded."
					}
				]
			},
			{
				"httpMethod": "DELETE",
				"summary": "Unload an Asterisk module.",
				"nickname": "unloadModule",
				"responseClass": "void",
				"parameters": [
					{
						"name": "moduleName",
						"description": "Module's name",
						"paramType": "path",
						"required": true,
						"allowMultiple": false,
						"dataType": "string"
					}
				],
				"errorResponses": [
					{
						"code": 404,
						"reason": "Module not found in running modules."
					},
					{
						"code": 409,
						"reason": "Module could not be unloaded."
					}
				]
			}
		]
	},
	{
		"path": "/asterisk/logging",
		"description": "Asterisk log channels",
		"operations": [
			{
				"httpMethod": "GET",
				"summary": "Gets Asterisk log channel information.",
				"nickname": "listLogChannels",
				"responseClass": "List[LogChannel]",
			}
		]
	},
	{
		"path": "/asterisk/logging/addlog{logChannelName}",
		"description": "Asterisk log channel",
		"operations": [
			{
				"httpMethod": "POST",
				"summary": "Adds a log channel.",
				"nickname": "addLog",
				"responseClass": "void",
				"parameters": [
					{
						"name": "channellogChannelName",
						"description": "The log channel to add",
						"paramType": "querypath",
						"required": true,
						"allowMultiple": false,
						"dataType": "string"
					},
					{
						"name": "levelsconfiguration",
						"description": "TheLevels logging levels of the log channel",
						"paramType": "query",
						"required": falsetrue,
						"allowMultiple": false,
						"dataType": "List[string]"
					}
				],
				"errorResponses": [
					{
						"code": 400,
						"reason": "Missing log channel parameter."
					},
				]
			}{
		]
	},
	{
		"pathcode": "/asterisk/logging/{logChannelName}/rotate"409,
						"descriptionreason": "AsteriskLog log channel",channel could not be created"
		"operations": [			}
				]
			},
			{
				"httpMethod": "PUTDELETE",
				"summary": "RotatesDeletes a log channel.",
				"nickname": "rotateLogdeleteLog",
				"responseClass": "void",
				"parameters": [
					{
						"name": "logChannelName",
						"description": "Log channel's name",
						"paramType": "path",
						"required": true,
						"allowMultiple": false,
						"dataType": "string"
					} 
				],
				"errorResponses": [
					{
						"code": 404,
						"reason": "Log channel does not exist."
					}
				]
			}
		]
	},
	{
		"path": "/asterisk/logging/{logChannelName}/rotate",
		"description": "Asterisk log channel",
		"operations": [
			{
				"httpMethod": "DELETEPUT",
				"summary": "DeletesRotates a log channel.",
				"nickname": "deleteLogrotateLog",
				"responseClass": "void",
				"parameters": [
					{
						"name": "logChannelName",
						"description": "Log channel's name",
						"paramType": "path",
						"required": true,
						"allowMultiple": false,
						"dataType": "string"
					}

				],
				"errorResponses": [
					{
						"code": 404,
						"reason": "Log channel does not exist."
					}
				]
			}
		]
	}
],
"models": [
	"Module": {
		"id": "Module",
		"description": "Details of an Asterisk module",
		"properties": {
			"name": {
				"type": "string",
				"description": "The name of this module",
				"required": true
			},
			"description": {
				"type": "string",
				"description": "The description of this module",
				"required": true
			},
			"use_count": {
				"type": "int",
				"description": "The number of times this module is being used",
				"required": true
			},
			"status": {
				"type": "string",
				"description": "The running status of this module",
				"required": true
			},
			"support_level": {
				"type": "string",
				"description": "The support state of this module",
				"required": true
			}
		}
	},
	"LogChannel": {
    		"id": "LogChannel",
		        "description": "Details of an Asterisk log channel",
		        "properties": {
			"name        	"channel": {
				            	"type": "string",
				                "description": "The name of this log channel path",
                "required": true
            },
            "type": {
                "type": "string",
                "description": "Types of logs for the log channel",
				                "required": true
			},
			"logging_levels            },
            "status": {
				                "type": "List[string]",
				                "description": "NamesWhether ofor not the logginglog levelstype foris this log channel",
				enabled",
                "required": true
            },
            "configuration": {
                "type": "List[string]",
                "description": "The various log levels",
                "required": true
			}
		}
	            }
        }
    }
]

Testing

TestPathPurpose
/asterisk/modules/get_modulestests/rest_apiVerify that Asterisk returns a list of loaded modules.
/asterisk/modules/get_moduletests/rest_apiVerify that Asterisk returns information on a module, whether it is loaded or not.
/asterisk/modules/get_unknown_moduletests/rest_apiVerify that trying to get information on a non-existent module returns a warning message saying that the module does not exist.
/asterisk/modules/load_moduletests/rest_apiVerify that a module is loaded to Asterisk, assuming it was not already loaded.
/asterisk/modules/load_already_loaded_moduletests/rest_apiVerify that loading a module that is already loaded results in a warning message saying that the module already exists.
/asterisk/modules/load_unknown_moduletests/rest_apiVerify that trying to load a module unknown to Asterisk results in two warning messages saying that the file does not exist, and Asterisk could not load the module.
/asterisk/modules/unload_moduletests/rest_apiVerify that a module was unloaded from Asterisk, assuming it was not already unloaded.
/asterisk/modules/unload_already_unloaded_moduletests/rest_apiVerify that unloading a module that is already unloaded results in a warning message saying that the unload failed, and that the module could not be found.
/asterisk/modules/unload_unknown_moduletests/rest_apiVerify that trying to unload a module unknown to Asterisk results in a warning message saying that the unload failed, and the module could not be found.
/asterisk/modules/reload_moduletests/rest_apiVerify that a module was reloaded to Asterisk.
/asterisk/modules/reload_unloaded_moduletests/rest_apiVerify that reloading a module that is unloaded from Asterisk results in a warning message saying that the module does not exist.
/asterisk/modules/reload_unknown_moduletests/rest_apiVerify that trying to reload a module unknown to Asterisk results in a warning message saying the module does not exist.
/asterisk/logging/get_loggingtests/rest_apiVerify that information on all log channels was retrieved.
/asterisk/logging/get_logging_channeltests/rest_apiVerify that information on a single log channel was retrieved.
/asterisk/logging/get_unknown_logging_channeltests/rest_apiVerify that trying to retrieve information on a non-existent log channel results in a warning message saying the log channel does not exist.
/asterisk/logging/add_loggingtests/rest_apiVerify that a log channel was added to a channel or bridge.
/asterisk/logging/add_already_existing_loggingtests/rest_apiVerify that trying to add a log channel that already exists (has the same name) results in a warning message saying the channel already exists, and the channel could not be added.
/asterisk/logging/add_logging_invalid_leveltests/rest_apiVerify that trying to add a log channel with a logging level that is unknown to Asterisk results in a warning message saying a logging level was invalid, and that the channel could not be added.
/asterisk/logging/rotate_loggingtests/rest_apiVerify that a log channel was rotated from a channel or bridge.
/asterisk/logging/rotate_unknown_loggingtests/rest_apiVerify that trying to rotate a non-existent log channel results in a warning message saying the log channel does not exist, and the channel could not be rotated.

...