Skip to content

Commit

Permalink
Inclusion of client code for cloud discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
AnilGadiyarHJ committed Aug 20, 2024
1 parent a0dc8bf commit 6575859
Show file tree
Hide file tree
Showing 65 changed files with 14,419 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package client

import (
"github.com/infobloxopen/bloxone-go-client/anycast"
"github.com/infobloxopen/bloxone-go-client/clouddiscovery"
"github.com/infobloxopen/bloxone-go-client/dfp"
"github.com/infobloxopen/bloxone-go-client/dnsconfig"
"github.com/infobloxopen/bloxone-go-client/dnsdata"
Expand All @@ -18,6 +19,7 @@ import (
// APIClient is an aggregation of different BloxOne API clients.
type APIClient struct {
IPAddressManagementAPI *ipam.APIClient
CloudDiscoveryAPI *clouddiscovery.APIClient
DNSConfigurationAPI *dnsconfig.APIClient
DNSDataAPI *dnsdata.APIClient
HostActivationAPI *infraprovision.APIClient
Expand Down Expand Up @@ -54,6 +56,7 @@ type APIClient struct {
func NewAPIClient(options ...option.ClientOption) *APIClient {
return &APIClient{
IPAddressManagementAPI: ipam.NewAPIClient(options...),
CloudDiscoveryAPI: clouddiscovery.NewAPIClient(options...),
DNSConfigurationAPI: dnsconfig.NewAPIClient(options...),
DNSDataAPI: dnsdata.NewAPIClient(options...),
HostActivationAPI: infraprovision.NewAPIClient(options...),
Expand Down
23 changes: 23 additions & 0 deletions clouddiscovery/.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
62 changes: 62 additions & 0 deletions clouddiscovery/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
.openapi-generator-ignore
README.md
api/openapi.yaml
api_accounts.go
api_providers.go
api_sub_accounts.go
client.go
docs/AccountsAPI.md
docs/ApiPageInfo.md
docs/DdidnsrickettsAccount.md
docs/DdidnsrickettsAccountListResponse.md
docs/DdidnsrickettsAdditionalConfig.md
docs/DdidnsrickettsCategory.md
docs/DdidnsrickettsCredentialConfig.md
docs/DdidnsrickettsCredentialPreference.md
docs/DdidnsrickettsDNSConfig.md
docs/DdidnsrickettsDestination.md
docs/DdidnsrickettsDestinationConfig.md
docs/DdidnsrickettsDiscoveryConfig.md
docs/DdidnsrickettsIPAMConfig.md
docs/DdidnsrickettsObject.md
docs/DdidnsrickettsObjectType.md
docs/DdidnsrickettsProviderCreateResponse.md
docs/DdidnsrickettsProviderListResponse.md
docs/DdidnsrickettsProviderReadResponse.md
docs/DdidnsrickettsProviderUpdateResponse.md
docs/DdidnsrickettsResource.md
docs/DdidnsrickettsSourceConfig.md
docs/DdidnsrickettsSubAccountListRequestV2.md
docs/DdidnsrickettsSubAccountListResponseV2.md
docs/DdidnsrickettsSubAccountProvCredConfig.md
docs/DdidnsrickettsSubAccountV2.md
docs/ProvidersAPI.md
docs/SubAccountsAPI.md
model_api_page_info.go
model_ddidnsricketts_account.go
model_ddidnsricketts_account_list_response.go
model_ddidnsricketts_additional_config.go
model_ddidnsricketts_category.go
model_ddidnsricketts_credential_config.go
model_ddidnsricketts_credential_preference.go
model_ddidnsricketts_destination.go
model_ddidnsricketts_destination_config.go
model_ddidnsricketts_discovery_config.go
model_ddidnsricketts_dns_config.go
model_ddidnsricketts_ipam_config.go
model_ddidnsricketts_object.go
model_ddidnsricketts_object_type.go
model_ddidnsricketts_provider_create_response.go
model_ddidnsricketts_provider_list_response.go
model_ddidnsricketts_provider_read_response.go
model_ddidnsricketts_provider_update_response.go
model_ddidnsricketts_resource.go
model_ddidnsricketts_source_config.go
model_ddidnsricketts_sub_account_list_request_v2.go
model_ddidnsricketts_sub_account_list_response_v2.go
model_ddidnsricketts_sub_account_prov_cred_config.go
model_ddidnsricketts_sub_account_v2.go
test/api_accounts_test.go
test/api_providers_test.go
test/api_sub_accounts_test.go
utils.go
1 change: 1 addition & 0 deletions clouddiscovery/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.5.0
143 changes: 143 additions & 0 deletions clouddiscovery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# Go API client for Discovery Configuration API V2

The Discovery configuration service is a BloxOne Service that provides configuration for accessing and syncing the Cloud assets

Base Paths:
1. provider: **_/api/cloud_discovery/v2/_**


## 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: v2
- Generator version: 7.5.0
- Build package: com.infoblox.codegen.BloxoneGoClientCodegen

## Installation

Install the package using `go get`:
```bash
go get github.com/infobloxopen/bloxone-go-client/clouddiscovery
```

Import the package into your code:
```go
import "github.com/infobloxopen/bloxone-go-client/clouddiscovery"
```

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

```go
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```

To create a new API client, you can use the `NewAPIClient` function as shown below
```go
client := clouddiscovery.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:
```go
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:
```go
client := clouddiscovery.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:

```go
client := clouddiscovery.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 Discovery Configuration API V2. You can obtain an API key by following the instructions in the guide for [Configuring User API Keys](https://docs.infoblox.com/space/BloxOneCloud/35430405/Configuring+User+API+Keys).

To use an API key with Discovery Configuration API V2, you can use the `option.WithAPIKey` option. For example:

```go
client := clouddiscovery.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:

```go
client := clouddiscovery.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://localhost*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AccountsAPI* | [**List**](docs/AccountsAPI.md#list) | **Get** /accounts | List Accounts
*ProvidersAPI* | [**Create**](docs/ProvidersAPI.md#create) | **Post** /providers | Create Provider
*ProvidersAPI* | [**Delete**](docs/ProvidersAPI.md#delete) | **Delete** /providers/{id} | Delete Provider
*ProvidersAPI* | [**List**](docs/ProvidersAPI.md#list) | **Get** /providers | List Provider
*ProvidersAPI* | [**Read**](docs/ProvidersAPI.md#read) | **Get** /providers/{id} | Read Provider
*ProvidersAPI* | [**Update**](docs/ProvidersAPI.md#update) | **Put** /providers/{id} | Update Provider
*SubAccountsAPI* | [**List**](docs/SubAccountsAPI.md#list) | **Post** /sub_accounts | List Sub-accounts


## Documentation For Models

- [ApiPageInfo](docs/ApiPageInfo.md)
- [DdidnsrickettsAccount](docs/DdidnsrickettsAccount.md)
- [DdidnsrickettsAccountListResponse](docs/DdidnsrickettsAccountListResponse.md)
- [DdidnsrickettsAdditionalConfig](docs/DdidnsrickettsAdditionalConfig.md)
- [DdidnsrickettsCategory](docs/DdidnsrickettsCategory.md)
- [DdidnsrickettsCredentialConfig](docs/DdidnsrickettsCredentialConfig.md)
- [DdidnsrickettsCredentialPreference](docs/DdidnsrickettsCredentialPreference.md)
- [DdidnsrickettsDNSConfig](docs/DdidnsrickettsDNSConfig.md)
- [DdidnsrickettsDestination](docs/DdidnsrickettsDestination.md)
- [DdidnsrickettsDestinationConfig](docs/DdidnsrickettsDestinationConfig.md)
- [DdidnsrickettsDiscoveryConfig](docs/DdidnsrickettsDiscoveryConfig.md)
- [DdidnsrickettsIPAMConfig](docs/DdidnsrickettsIPAMConfig.md)
- [DdidnsrickettsObject](docs/DdidnsrickettsObject.md)
- [DdidnsrickettsObjectType](docs/DdidnsrickettsObjectType.md)
- [DdidnsrickettsProviderCreateResponse](docs/DdidnsrickettsProviderCreateResponse.md)
- [DdidnsrickettsProviderListResponse](docs/DdidnsrickettsProviderListResponse.md)
- [DdidnsrickettsProviderReadResponse](docs/DdidnsrickettsProviderReadResponse.md)
- [DdidnsrickettsProviderUpdateResponse](docs/DdidnsrickettsProviderUpdateResponse.md)
- [DdidnsrickettsResource](docs/DdidnsrickettsResource.md)
- [DdidnsrickettsSourceConfig](docs/DdidnsrickettsSourceConfig.md)
- [DdidnsrickettsSubAccountListRequestV2](docs/DdidnsrickettsSubAccountListRequestV2.md)
- [DdidnsrickettsSubAccountListResponseV2](docs/DdidnsrickettsSubAccountListResponseV2.md)
- [DdidnsrickettsSubAccountProvCredConfig](docs/DdidnsrickettsSubAccountProvCredConfig.md)
- [DdidnsrickettsSubAccountV2](docs/DdidnsrickettsSubAccountV2.md)


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

0 comments on commit 6575859

Please sign in to comment.