# Packages
# README
Go API client for Infrastructure Management API
The Infrastructure Management API provides a RESTful interface to manage Infrastructure Hosts and Services objects.
The following is a list of the different Services and their string types (the string types are to be used with the APIs for the service_type
field):
Service name | Service type |
---|---|
Access Authentication | authn |
Anycast | anycast |
Data Connector | cdc |
DHCP | dhcp |
DNS | dns |
DNS Forwarding Proxy | dfp |
NIOS Grid Connector | orpheus |
MS AD Sync | msad |
NTP | ntp |
BGP | bgp |
RIP | rip |
OSPF | ospf |
Hosts API
The Hosts API is used to manage the Infrastructure Host resources. These include various operations related to hosts such as viewing, creating, updating, replacing, disconnecting, and deleting Hosts. Management of Hosts is done from the Cloud Services Portal (CSP) by navigating to the Manage -> Infrastructure -> Hosts tab.
Services API
The Services API is used to manage the Infrastructure Service resources (a.k.a. BloxOne applications). These include various operations related to hosts such as viewing, creating, updating, starting/stopping, configuring, and deleting Services. Management of Services is done from the Cloud Services Portal (CSP) by navigating to the Manage -> Infrastructure -> Services tab.
Detail APIs
The Detail APIs are read-only APIs used to list all the Infrastructure resources (Hosts and Services). Each resource record returned also contains information about its other associated resources and the status information for itself and the associated resource(s) (i.e., Host/Service status).
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: v1
- Generator version: 7.5.0
- Build package: com.infoblox.codegen.BloxoneGoClientCodegen
Installation
Install the package using go get
:
go get github.com/infobloxopen/bloxone-go-client/inframgmt
Import the package into your code:
import "github.com/infobloxopen/bloxone-go-client/inframgmt"
To use a proxy, set the environment variable HTTP_PROXY
:
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
To create a new API client, you can use the NewAPIClient
function as shown below
client := inframgmt.NewAPIClient()
Configuration
The NewAPIClient
function accepts a variadic list of option.ClientOption
functions that can be used to configure the client.
It requires the option
package to be imported. You can import the package using:
import "github.com/infobloxopen/bloxone-go-client/option"
Client Name
The client name is used to identify the client in the logs. By default, the client name is set to bloxone-go-client
. You can change this using the option.WithClientName
option. For example:
client := inframgmt.NewAPIClient(option.WithClientName("my-client"))
Server URL
The default URL for the Cloud Services Portal is https://csp.infoblox.com
. If you need to change this, you can use option.WithCSPUrl
to set the URL. For example:
client := inframgmt.NewAPIClient(option.WithCSPUrl("https://csp.eu.infoblox.com"))
You can also set the URL using the environment variable BLOXONE_CSP_URL
Authorization
An API key is required to access Infrastructure Management API. You can obtain an API key by following the instructions in the guide for Configuring User API Keys.
To use an API key with Infrastructure Management API, you can use the option.WithAPIKey
option. For example:
client := inframgmt.NewAPIClient(option.WithAPIKey("YOUR_API_KEY"))
You can also set the API key using the environment variable BLOXONE_API_KEY
Note: The API key is a secret and should be handled securely. Hardcoding the API key in your code is not recommended.
Default Tags
You can set default tags for all API requests using the option.WithDefaultTags
option. For example:
client := inframgmt.NewAPIClient(option.WithDefaultTags(map[string]string{"tag1": "value1", "tag2": "value2"}))
This will add the tags tag1=value1
and tag2=value2
to all API requests that support tags in the request body.
Documentation for API Endpoints
All URIs are relative to http://csp.infoblox.com/api/infra/v1
Class | Method | HTTP request | Description |
---|---|---|---|
DetailAPI | HostsList | Get /detail_hosts | List all the Hosts along with its associated Services (applications). |
DetailAPI | ServicesList | Get /detail_services | List all the Services (applications) along with its associated Hosts. |
HostsAPI | AssignTags | Post /hosts/assign_tags | Assign tags for list of hosts. |
HostsAPI | Create | Post /hosts | Create a Host resource. |
HostsAPI | Delete | Delete /hosts/{id} | Delete a Host resource. |
HostsAPI | Disconnect | Post /hosts/{id}/disconnect | Disconnect a Host by resource ID. |
HostsAPI | List | Get /hosts | List all the Host resources for an account. |
HostsAPI | Read | Get /hosts/{id} | Get a Host resource. |
HostsAPI | Replace | Post /hosts/{from.resource_id}/replace/{to.resource_id} | Migrate a Host's configuration from one to another. |
HostsAPI | UnassignTags | Post /hosts/unassign_tags | Unassign tag for the list hosts. |
HostsAPI | Update | Put /hosts/{id} | Update a Host resource. |
ServicesAPI | Applications | Get /applications | List applications (Service types) for a particular account. |
ServicesAPI | Create | Post /services | Create a Service resource. |
ServicesAPI | Delete | Delete /services/{id} | Delete a Service resource. |
ServicesAPI | List | Get /services | List all the Service resources for an account. |
ServicesAPI | Read | Get /services/{id} | Read a Service resource. |
ServicesAPI | Update | Put /services/{id} | Update a Service resource. |
Documentation For Models
- ApiPageInfo
- Applications
- ApplicationsResponse
- AssignTagsRequest
- CreateHostResponse
- CreateServiceResponse
- DetailHost
- DetailHostServiceConfig
- DetailLocation
- DetailService
- DetailServiceHost
- DetailServiceHostConfig
- DisconnectRequest
- GetHostResponse
- GetServiceResponse
- Host
- ListDetailHostsResponse
- ListDetailServicesResponse
- ListHostResponse
- ListServiceResponse
- PoolInfo
- ReplaceHostRequest
- Service
- ServiceHostConfig
- ShortServiceStatus
- UnassignTagsRequest
- UpdateHostResponse
- UpdateServiceResponse
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