# Packages

No description provided by the author

# 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 nameService type
Access Authenticationauthn
Anycastanycast
Data Connectorcdc
DHCPdhcp
DNSdns
DNS Forwarding Proxydfp
NIOS Grid Connectororpheus
MS AD Syncmsad
NTPntp
BGPbgp
RIPrip
OSPFospf

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

ClassMethodHTTP requestDescription
DetailAPIHostsListGet /detail_hostsList all the Hosts along with its associated Services (applications).
DetailAPIServicesListGet /detail_servicesList all the Services (applications) along with its associated Hosts.
HostsAPIAssignTagsPost /hosts/assign_tagsAssign tags for list of hosts.
HostsAPICreatePost /hostsCreate a Host resource.
HostsAPIDeleteDelete /hosts/{id}Delete a Host resource.
HostsAPIDisconnectPost /hosts/{id}/disconnectDisconnect a Host by resource ID.
HostsAPIListGet /hostsList all the Host resources for an account.
HostsAPIReadGet /hosts/{id}Get a Host resource.
HostsAPIReplacePost /hosts/{from.resource_id}/replace/{to.resource_id}Migrate a Host's configuration from one to another.
HostsAPIUnassignTagsPost /hosts/unassign_tagsUnassign tag for the list hosts.
HostsAPIUpdatePut /hosts/{id}Update a Host resource.
ServicesAPIApplicationsGet /applicationsList applications (Service types) for a particular account.
ServicesAPICreatePost /servicesCreate a Service resource.
ServicesAPIDeleteDelete /services/{id}Delete a Service resource.
ServicesAPIListGet /servicesList all the Service resources for an account.
ServicesAPIReadGet /services/{id}Read a Service resource.
ServicesAPIUpdatePut /services/{id}Update a Service resource.

Documentation For Models

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