Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client changes for Anycast #28

Merged
merged 4 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions anycast/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
39 changes: 39 additions & 0 deletions anycast/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
README.md
api_on_prem_anycast_manager.go
client.go
docs/OnPremAnycastManagerAPI.md
docs/ProtoAnycastConfig.md
docs/ProtoAnycastConfigRef.md
docs/ProtoAnycastConfigResponse.md
docs/ProtoAnycastVersion.md
docs/ProtoBgpConfig.md
docs/ProtoBgpNeighbor.md
docs/ProtoGetAnycastConfigListResponse.md
docs/ProtoOnpremHost.md
docs/ProtoOnpremHostRef.md
docs/ProtoOnpremHostResponse.md
docs/ProtoOspfConfig.md
docs/ProtoOspfv3Config.md
docs/ProtobufFieldMask.md
docs/ServiceConfig.md
docs/ServiceConfigObject.md
docs/ServiceStatusCode.md
docs/ServiceStatusUpdateRequest.md
model_proto_anycast_config.go
model_proto_anycast_config_ref.go
model_proto_anycast_config_response.go
model_proto_anycast_version.go
model_proto_bgp_config.go
model_proto_bgp_neighbor.go
model_proto_get_anycast_config_list_response.go
model_proto_onprem_host.go
model_proto_onprem_host_ref.go
model_proto_onprem_host_response.go
model_proto_ospf_config.go
model_proto_ospfv3_config.go
model_protobuf_field_mask.go
model_service_config.go
model_service_config_object.go
model_service_status_code.go
model_service_status_update_request.go
utils.go
1 change: 1 addition & 0 deletions anycast/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.0.1
171 changes: 171 additions & 0 deletions anycast/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# Go API client for anycast

Anycast capability enables HA (High Availability) configuration of BloxOne applications that run on equipment located on customer's premises (on-prem hosts). Anycast supports DNS, as well as DNS-forwarding services.

Anycast-enabled application setups use multiple on-premises installations for one particular application type. Multiple application instances are configured to use the same endpoint address. Anycast capability is collocated with such application instance, monitoring the local application instance and advertising to the upstream router (a customer equipment) a per-instance, local route to the common application endpoint address, as long as the local application instance is available. Depending on the type of the upstream router, the customer may configure local route advertisement via either BGP (Boarder Gateway Protocol) or OSPF (Open Shortest Path First) routing protocols. Both protocols may be enabled as well. Multiple routes to the common application service address provide redundancy without the need to reconfigure application clients.

Should an application instance become unavailable, the local route advertisements stop, resulting in withdrawal of the route (in the upstream router) to the application instance that has gone out of service and ensuring that subsequent application requests thus get routed to the remaining available application instances.



## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.

- API version: v1
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen

## Installation

Install the following dependencies:

```shell
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:

```golang
import anycast "github.com/infobloxopen/bloxone-go-client"
```

To use a proxy, set the environment variable `HTTP_PROXY`:

```golang
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 `sw.ContextServerIndex` of type `int`.

```golang
ctx := context.WithValue(context.Background(), anycast.ContextServerIndex, 1)
```

### Templated Server URL

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

```golang
ctx := context.WithValue(context.Background(), anycast.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 `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.

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

## Documentation for API Endpoints

All URIs are relative to *http://localhost/api/anycast/v1*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerCreateAnycastConfig**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagercreateanycastconfig) | **Post** /accm/ac_configs | Create Anycast Configuration
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerCreateAnycastVersion**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagercreateanycastversion) | **Post** /accm/ac_version/{id} | Create Anycast Version
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerDeleteAnycastConfig**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagerdeleteanycastconfig) | **Delete** /accm/ac_configs/{id} | Delete Anycast Configuration
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerDeleteAnycastVersion**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagerdeleteanycastversion) | **Delete** /accm/ac_version/{id} | Delete anycast version
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerDeleteOnpremHost**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagerdeleteonpremhost) | **Delete** /accm/op_hosts/{id} | Delete On-Prem Host
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerGetAnycastConfig**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagergetanycastconfig) | **Get** /accm/ac_configs/{id} | Retrieve Anycast Configuration
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerGetAnycastConfigList**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagergetanycastconfiglist) | **Get** /accm/ac_configs | Retrieve Multiple Anycast Configurations
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerGetAnycastVersion**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagergetanycastversion) | **Get** /accm/ac_version/{id} | Retrieve Anycast Version
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerGetOnpremConfig**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagergetonpremconfig) | **Get** /accm/oph_configs/{ophid}/{version} | Retrieve Generated, Per-Host Anycast Configuration
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerGetOnpremConfig2**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagergetonpremconfig2) | **Get** /onprem_config/{ophid}/{version} | Retrieve Generated, Per-Host Anycast Configuration
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerGetOnpremHost**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagergetonpremhost) | **Get** /accm/op_hosts/{id} | Retrieve On-Prem Host
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerGetStatus**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagergetstatus) | **Get** /accm/oph_config_statuses/{ophid}/latest | Retrieve Configuration Status
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerGetStatus2**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagergetstatus2) | **Get** /onprem_config_statuses/{ophid}/latest | Retrieve Configuration Status
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerListAnycastConfigsWithRuntimeStatus**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagerlistanycastconfigswithruntimestatus) | **Get** /accm/ac_runtime_statuses | Read list of Anycast Configurations
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerReadAnycastConfigWithRuntimeStatus**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagerreadanycastconfigwithruntimestatus) | **Get** /accm/ac_runtime_statuses/{id} | Read Anycast Configuration
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerUpdateAnycastConfig**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagerupdateanycastconfig) | **Put** /accm/ac_configs/{id} | Create or Update Anycast Configuration
*OnPremAnycastManagerAPI* | [**OnPremAnycastManagerUpdateOnpremHost**](docs/OnPremAnycastManagerAPI.md#onpremanycastmanagerupdateonpremhost) | **Put** /accm/op_hosts/{id} | Create or Update On-Prem Host


## Documentation For Models

- [ProtoAnycastConfig](docs/ProtoAnycastConfig.md)
- [ProtoAnycastConfigRef](docs/ProtoAnycastConfigRef.md)
- [ProtoAnycastConfigResponse](docs/ProtoAnycastConfigResponse.md)
- [ProtoAnycastVersion](docs/ProtoAnycastVersion.md)
- [ProtoBgpConfig](docs/ProtoBgpConfig.md)
- [ProtoBgpNeighbor](docs/ProtoBgpNeighbor.md)
- [ProtoGetAnycastConfigListResponse](docs/ProtoGetAnycastConfigListResponse.md)
- [ProtoOnpremHost](docs/ProtoOnpremHost.md)
- [ProtoOnpremHostRef](docs/ProtoOnpremHostRef.md)
- [ProtoOnpremHostResponse](docs/ProtoOnpremHostResponse.md)
- [ProtoOspfConfig](docs/ProtoOspfConfig.md)
- [ProtoOspfv3Config](docs/ProtoOspfv3Config.md)
- [ProtobufFieldMask](docs/ProtobufFieldMask.md)
- [ServiceConfig](docs/ServiceConfig.md)
- [ServiceConfigObject](docs/ServiceConfigObject.md)
- [ServiceStatusCode](docs/ServiceStatusCode.md)
- [ServiceStatusUpdateRequest](docs/ServiceStatusUpdateRequest.md)


## Documentation For Authorization


Authentication schemes defined for the API:
### ApiKeyAuth

- **Type**: API key
- **API key parameter name**: Authorization
- **Location**: HTTP header

Note, each API key must be added to a map of `map[string]APIKey` where the key is: Authorization and passed in as the auth context for each request.

Example

```golang
auth := context.WithValue(
context.Background(),
sw.ContextAPIKeys,
map[string]sw.APIKey{
"Authorization": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
```


## 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



Loading
Loading