Skip to content

Commit

Permalink
auto-generated version 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ionoscloudsdk committed Nov 27, 2024
1 parent 9b24ae9 commit 321d3e4
Show file tree
Hide file tree
Showing 16 changed files with 1,950 additions and 107 deletions.
195 changes: 90 additions & 105 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![Gitter](https://img.shields.io/gitter/room/ionos-cloud/sdk-general)](https://gitter.im/ionos-cloud/sdk-general)

# Go API client for ionoscloud

An enterprise-grade Database is provided as a Service (DBaaS) solution that
Expand All @@ -14,7 +16,7 @@ their concepts and lend well to making the experience smooth and intuitive.
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: 0.1.0
- Package version: 1.1.0
- Package version: 1.1.1
- Build package: org.openapitools.codegen.languages.GoClientCodegen

## Installation
Expand All @@ -23,138 +25,121 @@ Install the following dependencies:

```shell
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional
```

Put the package under your project folder and add the following in import:

```golang
import ionoscloud "github.com/ionos-cloud/sdk-go-dbaas-mariadb"
import "./ionoscloud"
```

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

```golang
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
```
All available server URLs are:

## Configuration of Server URL
- *https://mariadb.de-txl.ionos.com* - Berlin, Germany
- *https://mariadb.de-fra.ionos.com* - Frankfurt, Germany
- *https://mariadb.es-vit.ionos.com* - Logroño, Spain
- *https://mariadb.fr-par.ionos.com* - Paris, France
- *https://mariadb.gb-lhr.ionos.com* - London, Great Britain
- *https://mariadb.us-ewr.ionos.com* - Newark, USA
- *https://mariadb.us-las.ionos.com* - Las Vegas, USA
- *https://mariadb.us-mci.ionos.com* - Lenexa, USA

Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.
By default, *https://mariadb.de-txl.ionos.com* is used, however this can be overriden at authentication, either
by setting the `IONOS_API_URL` environment variable or by specifying the `hostUrl` parameter when
initializing the sdk client.

### Select Server Configuration

For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`.
The username and password or the authentication token can be manually specified when initializing
the sdk client:

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

### Templated Server URL
client := ionoscloud.NewAPIClient(ionoscloud.NewConfiguration(username, password, token, hostUrl))

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(), ionoscloud.ContextServerVariables, map[string]string{
"basePath": "v2",
})
```

Note, enum values are always validated and all unused variables are silently ignored.
Environment variables can also be used. The sdk uses the following variables:
- IONOS_TOKEN - login via token. This is the recommended way to authenticate.
- IONOS_USERNAME - to specify the username used to login
- IONOS_PASSWORD - to specify the password
- IONOS_API_URL - to specify the API server URL

## Documentation for API Endpoints

All URIs are relative to *https://mariadb.de-txl.ionos.com*
In this case, the client configuration needs to be initialized using `NewConfigurationFromEnv()`.

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*BackupsApi* | [**BackupsFindById**](docs/api/BackupsApi.md#backupsfindbyid) | **Get** /backups/{backupId} | Fetch backups
*BackupsApi* | [**BackupsGet**](docs/api/BackupsApi.md#backupsget) | **Get** /backups | List of backups.
*BackupsApi* | [**ClusterBackupsGet**](docs/api/BackupsApi.md#clusterbackupsget) | **Get** /clusters/{clusterId}/backups | List backups of cluster
*ClustersApi* | [**ClustersDelete**](docs/api/ClustersApi.md#clustersdelete) | **Delete** /clusters/{clusterId} | Delete a cluster
*ClustersApi* | [**ClustersFindById**](docs/api/ClustersApi.md#clustersfindbyid) | **Get** /clusters/{clusterId} | Fetch a cluster
*ClustersApi* | [**ClustersGet**](docs/api/ClustersApi.md#clustersget) | **Get** /clusters | List clusters
*ClustersApi* | [**ClustersPost**](docs/api/ClustersApi.md#clusterspost) | **Post** /clusters | Create a cluster


## Documentation For Models
```golang

- [Backup](docs/models/Backup.md)
- [BackupList](docs/models/BackupList.md)
- [BackupListAllOf](docs/models/BackupListAllOf.md)
- [BackupResponse](docs/models/BackupResponse.md)
- [BaseBackup](docs/models/BaseBackup.md)
- [ClusterList](docs/models/ClusterList.md)
- [ClusterListAllOf](docs/models/ClusterListAllOf.md)
- [ClusterMetadata](docs/models/ClusterMetadata.md)
- [ClusterProperties](docs/models/ClusterProperties.md)
- [ClusterResponse](docs/models/ClusterResponse.md)
- [ClustersGet400Response](docs/models/ClustersGet400Response.md)
- [ClustersGet401Response](docs/models/ClustersGet401Response.md)
- [ClustersGet403Response](docs/models/ClustersGet403Response.md)
- [ClustersGet404Response](docs/models/ClustersGet404Response.md)
- [ClustersGet405Response](docs/models/ClustersGet405Response.md)
- [ClustersGet415Response](docs/models/ClustersGet415Response.md)
- [ClustersGet422Response](docs/models/ClustersGet422Response.md)
- [ClustersGet429Response](docs/models/ClustersGet429Response.md)
- [ClustersGet500Response](docs/models/ClustersGet500Response.md)
- [ClustersGet503Response](docs/models/ClustersGet503Response.md)
- [Connection](docs/models/Connection.md)
- [CreateClusterProperties](docs/models/CreateClusterProperties.md)
- [CreateClusterRequest](docs/models/CreateClusterRequest.md)
- [DBUser](docs/models/DBUser.md)
- [DayOfTheWeek](docs/models/DayOfTheWeek.md)
- [ErrorMessage](docs/models/ErrorMessage.md)
- [MaintenanceWindow](docs/models/MaintenanceWindow.md)
- [MariadbVersion](docs/models/MariadbVersion.md)
- [Pagination](docs/models/Pagination.md)
- [PaginationLinks](docs/models/PaginationLinks.md)
- [State](docs/models/State.md)


## Documentation For Authorization


Authentication schemes defined for the API:
### tokenAuth

- **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
client := ionoscloud.NewAPIClient(ionoscloud.NewConfigurationFromEnv())

```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
## Documentation for API Endpoints

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:
All URIs are relative to *https://mariadb.de-txl.ionos.com*
<details >
<summary title="Click to toggle">API Endpoints table</summary>

* `PtrBool`
* `PtrInt`
* `PtrInt32`
* `PtrInt64`
* `PtrFloat`
* `PtrFloat32`
* `PtrFloat64`
* `PtrString`
* `PtrTime`

## Author
| Class | Method | HTTP request | Description |
| ------------- | ------------- | ------------- | ------------- |
| BackupsApi | [**BackupsFindById**](docs/api/BackupsApi.md#BackupsFindById) | **Get** /backups/{backupId} | Fetch backups |
| BackupsApi | [**BackupsGet**](docs/api/BackupsApi.md#BackupsGet) | **Get** /backups | List of backups. |
| BackupsApi | [**ClusterBackupsGet**](docs/api/BackupsApi.md#ClusterBackupsGet) | **Get** /clusters/{clusterId}/backups | List backups of cluster |
| ClustersApi | [**ClustersDelete**](docs/api/ClustersApi.md#ClustersDelete) | **Delete** /clusters/{clusterId} | Delete a cluster |
| ClustersApi | [**ClustersFindById**](docs/api/ClustersApi.md#ClustersFindById) | **Get** /clusters/{clusterId} | Fetch a cluster |
| ClustersApi | [**ClustersGet**](docs/api/ClustersApi.md#ClustersGet) | **Get** /clusters | List clusters |
| ClustersApi | [**ClustersPatch**](docs/api/ClustersApi.md#ClustersPatch) | **Patch** /clusters/{clusterId} | Update a cluster |
| ClustersApi | [**ClustersPost**](docs/api/ClustersApi.md#ClustersPost) | **Post** /clusters | Create a cluster |
| RestoreApi | [**ClustersRestore**](docs/api/RestoreApi.md#ClustersRestore) | **Post** /clusters/{clusterId}/restore | In-place restore of a cluster. |

</details>

## Documentation For Models

All URIs are relative to *https://mariadb.de-txl.ionos.com*
<details >
<summary title="Click to toggle">API models list</summary>

- [Backup](docs/models/Backup)
- [BackupList](docs/models/BackupList)
- [BackupListAllOf](docs/models/BackupListAllOf)
- [BackupResponse](docs/models/BackupResponse)
- [BaseBackup](docs/models/BaseBackup)
- [ClusterList](docs/models/ClusterList)
- [ClusterListAllOf](docs/models/ClusterListAllOf)
- [ClusterMetadata](docs/models/ClusterMetadata)
- [ClusterProperties](docs/models/ClusterProperties)
- [ClusterResponse](docs/models/ClusterResponse)
- [ClustersGet400Response](docs/models/ClustersGet400Response)
- [ClustersGet401Response](docs/models/ClustersGet401Response)
- [ClustersGet403Response](docs/models/ClustersGet403Response)
- [ClustersGet404Response](docs/models/ClustersGet404Response)
- [ClustersGet405Response](docs/models/ClustersGet405Response)
- [ClustersGet415Response](docs/models/ClustersGet415Response)
- [ClustersGet422Response](docs/models/ClustersGet422Response)
- [ClustersGet429Response](docs/models/ClustersGet429Response)
- [ClustersGet500Response](docs/models/ClustersGet500Response)
- [ClustersGet503Response](docs/models/ClustersGet503Response)
- [Connection](docs/models/Connection)
- [CreateClusterProperties](docs/models/CreateClusterProperties)
- [CreateClusterRequest](docs/models/CreateClusterRequest)
- [DBUser](docs/models/DBUser)
- [DayOfTheWeek](docs/models/DayOfTheWeek)
- [ErrorMessage](docs/models/ErrorMessage)
- [MaintenanceWindow](docs/models/MaintenanceWindow)
- [MariadbVersion](docs/models/MariadbVersion)
- [Pagination](docs/models/Pagination)
- [PaginationLinks](docs/models/PaginationLinks)
- [PatchClusterProperties](docs/models/PatchClusterProperties)
- [PatchClusterRequest](docs/models/PatchClusterRequest)
- [RestoreRequest](docs/models/RestoreRequest)
- [State](docs/models/State)


[[Back to API list]](#documentation-for-api-endpoints) [[Back to Model list]](#documentation-for-models)

</details>
Loading

0 comments on commit 321d3e4

Please sign in to comment.