deleteMetric
Delete complex metric
/hosts/{hostname}/metrics/{metric_id}
Usage and SDK Samples
curl -X DELETE -H "Authorization: [[apiKey]]" "http://tbajorek.pl:4000/hosts/{hostname}/metrics/{metric_id}"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.HostsApi;
import java.io.File;
import java.util.*;
public class HostsApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: APIKeyHeader
ApiKeyAuth APIKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyHeader");
APIKeyHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.setApiKeyPrefix("Token");
HostsApi apiInstance = new HostsApi();
String metricId = metricId_example; // String | Metric identyfier. It has the same form as `metric_id` field of `Metric` model
String hostname = hostname_example; // String | Target host (domain name)
try {
Object result = apiInstance.deleteMetric(metricId, hostname);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HostsApi#deleteMetric");
e.printStackTrace();
}
}
}
import io.swagger.client.api.HostsApi;
public class HostsApiExample {
public static void main(String[] args) {
HostsApi apiInstance = new HostsApi();
String metricId = metricId_example; // String | Metric identyfier. It has the same form as `metric_id` field of `Metric` model
String hostname = hostname_example; // String | Target host (domain name)
try {
Object result = apiInstance.deleteMetric(metricId, hostname);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling HostsApi#deleteMetric");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: APIKeyHeader)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Authorization"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"Authorization"];
String *metricId = metricId_example; // Metric identyfier. It has the same form as `metric_id` field of `Metric` model
String *hostname = hostname_example; // Target host (domain name)
HostsApi *apiInstance = [[HostsApi alloc] init];
// Delete complex metric
[apiInstance deleteMetricWith:metricId
hostname:hostname
completionHandler: ^(Object output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var ResMonDistributedResourcesMonitoring = require('res_mon___distributed_resources_monitoring');
var defaultClient = ResMonDistributedResourcesMonitoring.ApiClient.instance;
// Configure API key authorization: APIKeyHeader
var APIKeyHeader = defaultClient.authentications['APIKeyHeader'];
APIKeyHeader.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyHeader.apiKeyPrefix['Authorization'] = "Token"
var api = new ResMonDistributedResourcesMonitoring.HostsApi()
var metricId = metricId_example; // {String} Metric identyfier. It has the same form as `metric_id` field of `Metric` model
var hostname = hostname_example; // {String} Target host (domain name)
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.deleteMetric(metricId, hostname, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class deleteMetricExample
{
public void main()
{
// Configure API key authorization: APIKeyHeader
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new HostsApi();
var metricId = metricId_example; // String | Metric identyfier. It has the same form as `metric_id` field of `Metric` model
var hostname = hostname_example; // String | Target host (domain name)
try
{
// Delete complex metric
Object result = apiInstance.deleteMetric(metricId, hostname);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling HostsApi.deleteMetric: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: APIKeyHeader
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$api_instance = new Swagger\Client\Api\HostsApi();
$metricId = metricId_example; // String | Metric identyfier. It has the same form as `metric_id` field of `Metric` model
$hostname = hostname_example; // String | Target host (domain name)
try {
$result = $api_instance->deleteMetric($metricId, $hostname);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling HostsApi->deleteMetric: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::HostsApi;
# Configure API key authorization: APIKeyHeader
$WWW::SwaggerClient::Configuration::api_key->{'Authorization'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'Authorization'} = "Bearer";
my $api_instance = WWW::SwaggerClient::HostsApi->new();
my $metricId = metricId_example; # String | Metric identyfier. It has the same form as `metric_id` field of `Metric` model
my $hostname = hostname_example; # String | Target host (domain name)
eval {
my $result = $api_instance->deleteMetric(metricId => $metricId, hostname => $hostname);
print Dumper($result);
};
if ($@) {
warn "Exception when calling HostsApi->deleteMetric: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: APIKeyHeader
swagger_client.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.HostsApi()
metricId = metricId_example # String | Metric identyfier. It has the same form as `metric_id` field of `Metric` model
hostname = hostname_example # String | Target host (domain name)
try:
# Delete complex metric
api_response = api_instance.delete_metric(metricId, hostname)
pprint(api_response)
except ApiException as e:
print("Exception when calling HostsApi->deleteMetric: %s\n" % e)
Parameters
Path parameters
| Name | Description |
|---|---|
| metric_id* |
String
Metric identyfier. It has the same form as `metric_id` field of `Metric` model
Required
|
| hostname* |
String
Target host (domain name)
Required
|
Responses
Status: 200 - Success
| Name | Type | Format | Description |
|---|---|---|---|
| Access-Control-Allow-Origin | String | It indicates whether the response can be shared with resources with the given origin | |
| Access-Control-Allow-Headers | String | It is used in response to a preflight request to indicate which HTTP headers can be used during the actual request | |
| Access-Control-Allow-Methods | String | It specifies the method or methods allowed when accessing the resource in response to a preflight request |