Skip to content

Latest commit

 

History

History
145 lines (109 loc) · 7.33 KB

README.md

File metadata and controls

145 lines (109 loc) · 7.33 KB

Go API client for BloxOne Redirect API

You can configure BloxOne Threat Defense Cloud to redirect traffic to the Infoblox server that displays the default or customized redirect page. You can redirect traffic to a custom destination using custom redirects.

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

Import the package into your code:

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

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 := redirect.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 := redirect.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 := redirect.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 BloxOne Redirect 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 BloxOne Redirect API, you can use the option.WithAPIKey option. For example:

client := redirect.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 := redirect.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 https://csp.infoblox.com/api/atcfw/v1

Class Method HTTP request Description
CertificateAPI GetProxyCertificates Get /cert_download_urls Get Proxy Certificates
CustomRedirectsAPI CreateCustomRedirect Post /custom_redirects Create Custom Redirect.
CustomRedirectsAPI DeleteCustomRedirect Delete /custom_redirects Delete Custom Redirect.
CustomRedirectsAPI DeleteSingleCustomRedirect Delete /custom_redirects/{id} Delete Custom Redirect By Id.
CustomRedirectsAPI ListCustomRedirect Get /custom_redirects List Custom Redirects.
CustomRedirectsAPI ReadCustomRedirect Get /custom_redirects/{id} Read Custom Redirect.
CustomRedirectsAPI UpdateCustomRedirect Put /custom_redirects/{id} Update Custom Redirect.
RedirectPageAPI ReadRedirectPage Get /redirect_page Read Redirect Page.
RedirectPageAPI UpdateRedirectPage Put /redirect_page Update Redirect Page.

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