Skip to content

Latest commit

 

History

History
299 lines (260 loc) · 16.4 KB

README.md

File metadata and controls

299 lines (260 loc) · 16.4 KB

Go API client for smartview

Empower yourself with Environmental APIs. The API makes it possible to fetch current environmental data including humidity and temperature for a single sensor (identified by IBX code and sensor ID) or for all the sensors within an IBX (identified by IBX code) in a paginated way. When fetching all sensor readings you can apply additional sort criteria.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 2.0
  • Package version: 0.47.0
  • Generator version: 7.4.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://docs.equinix.com/api-support.htm

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import smartview "github.com/equinix/equinix-sdk-go/services/smartview"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value smartview.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), smartview.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value smartview.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), smartview.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using smartview.ContextOperationServerIndices and smartview.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), smartview.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), smartview.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.equinix.com

Class Method HTTP request Description
AlertLogApi GetAlertActivityLog Get /smartview/v1/alerts/getAlertActivityLog get alert activity logs
AlertsApi GetAlerts Get /smartview/v1/alerts/getAlerts obtain active SmartView alerts.
DCIMPowerApi Mixin0 Post /power/v1/current Fetch current power consumption data
DCIMPowerApi Mixin0_0 Get /power/v1/trending Fetch Trending Power Data.
DCIMPowerApi PowerV1CurrentGet Get /power/v1/current Fetch current power consumption data
DefaultApi CreateSubscription Post /smartview/v2/streaming/subscriptions Create subscription endpoint
DefaultApi DeleteSubscriptionById Delete /smartview/v2/streaming/subscriptions/{id} Delete subscription endpoint
DefaultApi GetAllSubscriptions Get /smartview/v2/streaming/subscriptions Get all subscription endpoint
DefaultApi GetSubscriptionById Get /smartview/v2/streaming/subscriptions/{id} Get subscription endpoint
DefaultApi GetSubscriptionData Get /smartview/v2/streaming/subscriptionData/{subscriptionId} Get subscription data via REST
DefaultApi UpdateSubscription Put /smartview/v2/streaming/subscriptions/{id} Update subscription endpoint
SmartViewAssetsApi GetAffectedAsset Get /smartview/v1/asset/tagpoint/affected-assets get affected customers assets hierarchy
SmartViewAssetsApi GetAsset Get /smartview/v1/asset/list get assets list information
SmartViewAssetsApi GetAssetDetails Get /smartview/v1/asset/details get details for an asset.
SmartViewAssetsApi GetCurrentTagPoint Get /smartview/v1/asset/tagpoint/current obtain latest tag point data
SmartViewAssetsApi GetTagpointTrending Get /smartview/v1/asset/tagpoint/trending obtain trending tag point data
SmartViewAssetsApi Mixin4 Post /smartview/v1/asset/details get asset details
SmartViewAssetsApi Mixin4_0 Post /smartview/v1/asset/tagpoint/current get current tag points data
SmartViewAssetsApi SearchAsset Get /smartview/v1/asset/search Search for Assets matching identifiers
SmartViewEnvironmentApi Mixin1 Get /environment/v1/current Get current environmental data
SmartViewEnvironmentApi Mixin1_0 Get /environment/v1/listCurrent Fetch list of environmental data
SmartViewEnvironmentApi Mixin1_1 Get /environment/v1/trending Fetch trending environmental data
SmartViewEnvironmentalApi GetSensorReadings Get /smartview/v2/environmental/ibxs/{ibx}/sensors/readings IBX sensors current readings
SmartViewEnvironmentalApi GetSingleSensorReadings Get /smartview/v2/environmental/ibxs/{ibx}/sensors/{sensorId}/readings Single sensor current value(s)
SmartViewHierarchyAPIsApi GetLocationHierarchy Get /smartview/v1/hierarchy/location Fetch the Location Hierarchy
SmartViewHierarchyAPIsApi GetPowerHierarchy Get /smartview/v1/hierarchy/power Fetch the Power Hierarchy

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author