performPowerCycle
+Perform PoE power cycle for some PoE ports.
++
/device/{serialNumber}/powercycle
+ +
Usage and SDK Samples
+ + + +curl -X POST \
+-H "X-API-KEY: [[apiKey]]" \
+ -H "Authorization: Bearer [[accessToken]]" \
+ -H "Content-Type: application/json" \
+ "https://localhost:16001/api/v1/device/{serialNumber}/powercycle" \
+ -d '{
+ "serial" : "serial",
+ "ports" : [ {
+ "name" : "[\"Ethernet0\"]",
+ "cycle" : 36165
+ }, {
+ "name" : "[\"Ethernet0\"]",
+ "cycle" : 36165
+ } ],
+ "when" : 0
+}'
+
+ import org.openapitools.client.*;
+import org.openapitools.client.auth.*;
+import org.openapitools.client.model.*;
+import org.openapitools.client.api.CommandsApi;
+
+import java.io.File;
+import java.util.*;
+
+public class CommandsApiExample {
+ public static void main(String[] args) {
+ ApiClient defaultClient = Configuration.getDefaultApiClient();
+
+ // Configure API key authorization: ApiKeyAuth
+ ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
+ ApiKeyAuth.setApiKey("YOUR API KEY");
+ // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+ //ApiKeyAuth.setApiKeyPrefix("Token");
+
+ // Configure Bearer (JWT) access token for authorization: bearerAuth
+ HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
+ bearerAuth.setBearerToken("BEARER TOKEN");
+
+ // Create an instance of the API class
+ CommandsApi apiInstance = new CommandsApi();
+ String serialNumber = serialNumber_example; // String |
+ array[PowerCycleRequest] powerCycleRequest = ; // array[PowerCycleRequest] |
+
+ try {
+ apiInstance.performPowerCycle(serialNumber, powerCycleRequest);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CommandsApi#performPowerCycle");
+ e.printStackTrace();
+ }
+ }
+}
+
+ import org.openapitools.client.api.CommandsApi;
+
+public class CommandsApiExample {
+ public static void main(String[] args) {
+ CommandsApi apiInstance = new CommandsApi();
+ String serialNumber = serialNumber_example; // String |
+ array[PowerCycleRequest] powerCycleRequest = ; // array[PowerCycleRequest] |
+
+ try {
+ apiInstance.performPowerCycle(serialNumber, powerCycleRequest);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling CommandsApi#performPowerCycle");
+ e.printStackTrace();
+ }
+ }
+}
+ Configuration *apiConfig = [Configuration sharedConfig];
+
+// Configure API key authorization: (authentication scheme: ApiKeyAuth)
+[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"X-API-KEY"];
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"X-API-KEY"];
+
+// Configure Bearer (JWT) access token for authorization: bearerAuth
+[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];
+
+// Create an instance of the API class
+CommandsApi *apiInstance = [[CommandsApi alloc] init];
+String *serialNumber = serialNumber_example; // (default to null)
+array[PowerCycleRequest] *powerCycleRequest = ; // (optional)
+
+// Perform PoE power cycle for some PoE ports.
+[apiInstance performPowerCycleWith:serialNumber
+ powerCycleRequest:powerCycleRequest
+ completionHandler: ^(NSError* error) {
+ if (error) {
+ NSLog(@"Error: %@", error);
+ }
+}];
+
+ var UCentralGatewayApi = require('u_central_gateway_api');
+var defaultClient = UCentralGatewayApi.ApiClient.instance;
+
+// Configure API key authorization: ApiKeyAuth
+var ApiKeyAuth = defaultClient.authentications['ApiKeyAuth'];
+ApiKeyAuth.apiKey = "YOUR API KEY";
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiKeyAuth.apiKeyPrefix['X-API-KEY'] = "Token";
+
+// Configure Bearer (JWT) access token for authorization: bearerAuth
+var bearerAuth = defaultClient.authentications['bearerAuth'];
+bearerAuth.accessToken = "YOUR ACCESS TOKEN";
+
+// Create an instance of the API class
+var api = new UCentralGatewayApi.CommandsApi()
+var serialNumber = serialNumber_example; // {String}
+var opts = {
+ 'powerCycleRequest': // {array[PowerCycleRequest]}
+};
+
+var callback = function(error, data, response) {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully.');
+ }
+};
+api.performPowerCycle(serialNumber, opts, callback);
+
+ using System;
+using System.Diagnostics;
+using Org.OpenAPITools.Api;
+using Org.OpenAPITools.Client;
+using Org.OpenAPITools.Model;
+
+namespace Example
+{
+ public class performPowerCycleExample
+ {
+ public void main()
+ {
+ // Configure API key authorization: ApiKeyAuth
+ Configuration.Default.ApiKey.Add("X-API-KEY", "YOUR_API_KEY");
+ // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+ // Configuration.Default.ApiKeyPrefix.Add("X-API-KEY", "Bearer");
+ // Configure Bearer (JWT) access token for authorization: bearerAuth
+ Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
+
+ // Create an instance of the API class
+ var apiInstance = new CommandsApi();
+ var serialNumber = serialNumber_example; // String | (default to null)
+ var powerCycleRequest = new array[PowerCycleRequest](); // array[PowerCycleRequest] | (optional)
+
+ try {
+ // Perform PoE power cycle for some PoE ports.
+ apiInstance.performPowerCycle(serialNumber, powerCycleRequest);
+ } catch (Exception e) {
+ Debug.Print("Exception when calling CommandsApi.performPowerCycle: " + e.Message );
+ }
+ }
+ }
+}
+
+ <?php
+require_once(__DIR__ . '/vendor/autoload.php');
+
+// Configure API key authorization: ApiKeyAuth
+OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
+// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+// OpenAPITools\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');
+
+// Configure Bearer (JWT) access token for authorization: bearerAuth
+OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('', 'YOUR_ACCESS_TOKEN');
+
+// Create an instance of the API class
+$api_instance = new OpenAPITools\Client\Api\CommandsApi();
+$serialNumber = serialNumber_example; // String |
+$powerCycleRequest = ; // array[PowerCycleRequest] |
+
+try {
+ $api_instance->performPowerCycle($serialNumber, $powerCycleRequest);
+} catch (Exception $e) {
+ echo 'Exception when calling CommandsApi->performPowerCycle: ', $e->getMessage(), PHP_EOL;
+}
+?>
+ use Data::Dumper;
+use WWW::OPenAPIClient::Configuration;
+use WWW::OPenAPIClient::CommandsApi;
+
+# Configure API key authorization: ApiKeyAuth
+$WWW::OPenAPIClient::Configuration::api_key->{'X-API-KEY'} = 'YOUR_API_KEY';
+# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+#$WWW::OPenAPIClient::Configuration::api_key_prefix->{'X-API-KEY'} = "Bearer";
+
+# Configure Bearer (JWT) access token for authorization: bearerAuth
+$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
+
+# Create an instance of the API class
+my $api_instance = WWW::OPenAPIClient::CommandsApi->new();
+my $serialNumber = serialNumber_example; # String |
+my $powerCycleRequest = [WWW::OPenAPIClient::Object::array[PowerCycleRequest]->new()]; # array[PowerCycleRequest] |
+
+eval {
+ $api_instance->performPowerCycle(serialNumber => $serialNumber, powerCycleRequest => $powerCycleRequest);
+};
+if ($@) {
+ warn "Exception when calling CommandsApi->performPowerCycle: $@\n";
+}
+ from __future__ import print_statement
+import time
+import openapi_client
+from openapi_client.rest import ApiException
+from pprint import pprint
+
+# Configure API key authorization: ApiKeyAuth
+openapi_client.configuration.api_key['X-API-KEY'] = 'YOUR_API_KEY'
+# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
+# openapi_client.configuration.api_key_prefix['X-API-KEY'] = 'Bearer'
+
+# Configure Bearer (JWT) access token for authorization: bearerAuth
+openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
+
+# Create an instance of the API class
+api_instance = openapi_client.CommandsApi()
+serialNumber = serialNumber_example # String | (default to null)
+powerCycleRequest = # array[PowerCycleRequest] | (optional)
+
+try:
+ # Perform PoE power cycle for some PoE ports.
+ api_instance.perform_power_cycle(serialNumber, powerCycleRequest=powerCycleRequest)
+except ApiException as e:
+ print("Exception when calling CommandsApi->performPowerCycle: %s\n" % e)
+ extern crate CommandsApi;
+
+pub fn main() {
+ let serialNumber = serialNumber_example; // String
+ let powerCycleRequest = ; // array[PowerCycleRequest]
+
+ let mut context = CommandsApi::Context::default();
+ let result = client.performPowerCycle(serialNumber, powerCycleRequest, &context).wait();
+
+ println!("{:?}", result);
+}
+
+ Scopes
+Parameters
+ +Name | +Description | +
---|---|
serialNumber* | +
+
+
+
+
+
+
+
+
+ String
+
+
+
+
+ Required
+
+ |
+
Name | +Description | +
---|---|
powerCycleRequest | +
+ Certificate update details + + + |
+