-
Notifications
You must be signed in to change notification settings - Fork 11
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
PTOCP-947: Client generated code for upgrade policy #43
Merged
+9,055
−0
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f434393
PTOCP-947: Client generated code for upgrade policy
shrutipathak2 c66fa93
Updating the upgrade policy client
shrutipathak2 5b02fb4
Addressing review comments
shrutipathak2 a8cc478
Updating project readme
shrutipathak2 5863fe1
Moving upgrade policy to bloxone cloud
shrutipathak2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
.openapi-generator-ignore | ||
README.md | ||
api/openapi.yaml | ||
api_upgrade_policy_v2.go | ||
client.go | ||
docs/ApplyConfigNowRequest.md | ||
docs/ApplyConfigNowResponse.md | ||
docs/ApplyConfigNowStatus.md | ||
docs/BatchMaintenanceWindow.md | ||
docs/BatchMaintenanceWindowRequest.md | ||
docs/BatchMaintenanceWindowResponse.md | ||
docs/BatchMaintenanceWindowResult.md | ||
docs/CreateMaintenanceWindow.md | ||
docs/CreateMaintenanceWindowRequest.md | ||
docs/CreateMaintenanceWindowResponse.md | ||
docs/DeferredWindow.md | ||
docs/DeleteMaintenanceWindowResponse.md | ||
docs/GetMaintenanceWindowResponse.md | ||
docs/ListMaintenanceWindowResponse.md | ||
docs/MaintenanceWindow.md | ||
docs/OnpremDetails.md | ||
docs/ScheduledWindow.md | ||
docs/StatusCode.md | ||
docs/UpdateBatchMaintenanceWindow.md | ||
docs/UpdateMaintenanceWindow.md | ||
docs/UpdateMaintenanceWindowRequest.md | ||
docs/UpdateMaintenanceWindowResponse.md | ||
docs/UpgradePolicyV2API.md | ||
model_apply_config_now_request.go | ||
model_apply_config_now_response.go | ||
model_apply_config_now_status.go | ||
model_batch_maintenance_window.go | ||
model_batch_maintenance_window_request.go | ||
model_batch_maintenance_window_response.go | ||
model_batch_maintenance_window_result.go | ||
model_create_maintenance_window.go | ||
model_create_maintenance_window_request.go | ||
model_create_maintenance_window_response.go | ||
model_deferred_window.go | ||
model_delete_maintenance_window_response.go | ||
model_get_maintenance_window_response.go | ||
model_list_maintenance_window_response.go | ||
model_maintenance_window.go | ||
model_onprem_details.go | ||
model_scheduled_window.go | ||
model_status_code.go | ||
model_update_batch_maintenance_window.go | ||
model_update_maintenance_window.go | ||
model_update_maintenance_window_request.go | ||
model_update_maintenance_window_response.go | ||
test/api_upgrade_policy_v2_test.go | ||
utils.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
# Go API client for Schedule Software/Config Updates | ||
|
||
Infoblox by default does automatic software updates when they become available. Updates are applied to all on-prem hosts, physical or virtual. However, you can override and schedule the software updates. You can also defer the updates to a later date and time. You can configure up to a total of 50 deferrals (scheduled and deferred software updates), which means you have the flexibility to create up to 50 update groups across different on-prem hosts by mapping with appropriate tags. Tags are be used to associate deferrals (scheduled or deferred) with a specific or group of onprem-hosts. Apart from software update deferrals, config update deferrals also can be configured using these overrides. | ||
|
||
## 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/upgradepolicy | ||
``` | ||
|
||
Import the package into your code: | ||
```go | ||
import "github.com/infobloxopen/bloxone-go-client/upgradepolicy" | ||
``` | ||
|
||
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 := upgradepolicy.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 := upgradepolicy.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 := upgradepolicy.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 Schedule Software/Config Updates. 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 Schedule Software/Config Updates, you can use the `option.WithAPIKey` option. For example: | ||
|
||
```go | ||
client := upgradepolicy.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 := upgradepolicy.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/upgrade_policy* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*UpgradePolicyV2API* | [**ApplyConfigNow**](docs/UpgradePolicyV2API.md#applyconfignow) | **Post** /v2/config/apply_now | Immediately apply the config updates object to the list of hosts | ||
*UpgradePolicyV2API* | [**Batch**](docs/UpgradePolicyV2API.md#batch) | **Post** /v2/maintenance_windows/batch | Create, update and/or delete multiple maintenance windows in a single request | ||
*UpgradePolicyV2API* | [**Create**](docs/UpgradePolicyV2API.md#create) | **Post** /v2/maintenance_windows | Create a maintenance window | ||
*UpgradePolicyV2API* | [**Delete**](docs/UpgradePolicyV2API.md#delete) | **Delete** /v2/maintenance_windows/{id} | Delete maintenance window | ||
*UpgradePolicyV2API* | [**Get**](docs/UpgradePolicyV2API.md#get) | **Get** /v2/maintenance_windows/{id} | Read a maintenance window | ||
*UpgradePolicyV2API* | [**List**](docs/UpgradePolicyV2API.md#list) | **Get** /v2/maintenance_windows | List all the maintenance windows | ||
*UpgradePolicyV2API* | [**Update**](docs/UpgradePolicyV2API.md#update) | **Patch** /v2/maintenance_windows/{id} | Update an existing maintenance window | ||
|
||
|
||
## Documentation For Models | ||
|
||
- [ApplyConfigNowRequest](docs/ApplyConfigNowRequest.md) | ||
- [ApplyConfigNowResponse](docs/ApplyConfigNowResponse.md) | ||
- [ApplyConfigNowStatus](docs/ApplyConfigNowStatus.md) | ||
- [BatchMaintenanceWindow](docs/BatchMaintenanceWindow.md) | ||
- [BatchMaintenanceWindowRequest](docs/BatchMaintenanceWindowRequest.md) | ||
- [BatchMaintenanceWindowResponse](docs/BatchMaintenanceWindowResponse.md) | ||
- [BatchMaintenanceWindowResult](docs/BatchMaintenanceWindowResult.md) | ||
- [CreateMaintenanceWindow](docs/CreateMaintenanceWindow.md) | ||
- [CreateMaintenanceWindowRequest](docs/CreateMaintenanceWindowRequest.md) | ||
- [CreateMaintenanceWindowResponse](docs/CreateMaintenanceWindowResponse.md) | ||
- [DeferredWindow](docs/DeferredWindow.md) | ||
- [DeleteMaintenanceWindowResponse](docs/DeleteMaintenanceWindowResponse.md) | ||
- [GetMaintenanceWindowResponse](docs/GetMaintenanceWindowResponse.md) | ||
- [ListMaintenanceWindowResponse](docs/ListMaintenanceWindowResponse.md) | ||
- [MaintenanceWindow](docs/MaintenanceWindow.md) | ||
- [OnpremDetails](docs/OnpremDetails.md) | ||
- [ScheduledWindow](docs/ScheduledWindow.md) | ||
- [StatusCode](docs/StatusCode.md) | ||
- [UpdateBatchMaintenanceWindow](docs/UpdateBatchMaintenanceWindow.md) | ||
- [UpdateMaintenanceWindow](docs/UpdateMaintenanceWindow.md) | ||
- [UpdateMaintenanceWindowRequest](docs/UpdateMaintenanceWindowRequest.md) | ||
- [UpdateMaintenanceWindowResponse](docs/UpdateMaintenanceWindowResponse.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` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move this to be under
## Bloxone Cloud
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done