Skip to content

Latest commit

 

History

History
137 lines (100 loc) · 5.61 KB

README.md

File metadata and controls

137 lines (100 loc) · 5.61 KB

Go API client for DDI Keys API

The DDI Keys application is a BloxOne DDI service for managing TSIG keys and GSS-TSIG (Kerberos) keys which are used by other BloxOne DDI applications. It is part of the full-featured, DDI cloud solution that enables customers to deploy large numbers of protocol servers to deliver DNS and DHCP throughout their enterprise network.

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/keys

Import the package into your code:

import "github.com/infobloxopen/bloxone-go-client/keys"

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 := keys.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 := keys.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 := keys.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 DDI Keys 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 DDI Keys API, you can use the option.WithAPIKey option. For example:

client := keys.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 := keys.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/ddi/v1

Class Method HTTP request Description
GenerateTsigAPI GenerateTSIG Get /keys/generate_tsig Generate TSIG key with a random secret.
KerberosAPI Delete Delete /keys/kerberos/{id} Delete the Kerberos key.
KerberosAPI List Get /keys/kerberos Retrieve Kerberos keys.
KerberosAPI Read Get /keys/kerberos/{id} Retrieve the Kerberos key.
KerberosAPI Update Patch /keys/kerberos/{id} Update the Kerberos key.
TsigAPI Create Post /keys/tsig Create the TSIG key.
TsigAPI Delete Delete /keys/tsig/{id} Delete the TSIG key.
TsigAPI List Get /keys/tsig Retrieve TSIG keys.
TsigAPI Read Get /keys/tsig/{id} Retrieve the TSIG key.
TsigAPI Update Patch /keys/tsig/{id} Update the TSIG key.
UploadAPI Upload Post /keys/upload Upload content to the keys service.

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