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 Jan 16, 2025
1 parent 5b6a9b0 commit e14bd4c
Show file tree
Hide file tree
Showing 35 changed files with 168 additions and 139 deletions.
178 changes: 84 additions & 94 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

The RESTful API for managing Network File Storage.
Expand All @@ -6,8 +8,8 @@ The RESTful API for managing Network File Storage.
## 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: 0.1.1
- Package version: 1.1.0
- API version: 0.1.3
- Package version: 1.1.1
- Build package: org.openapitools.codegen.languages.GoClientCodegen
For more information, please visit [https://docs.ionos.com/support/general-information/contact-information](https://docs.ionos.com/support/general-information/contact-information)

Expand All @@ -17,125 +19,113 @@ 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-nfs"
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://nfs.de-fra.ionos.com* - Frankfurt, Germany
- *https://nfs.de-txl.ionos.com* - Berlin, Germany
- *https://nfs.fr-par.ionos.com* - Paris, France
- *https://nfs.gb-lhr.ionos.com* - London, Great Britain
- *https://nfs.es-vit.ionos.com* - Logroño, Spain
- *https://nfs.us-las.ionos.com* - Las Vegas, USA
- *https://nfs.us-ewr.ionos.com* - Newark, USA
- *https://nfs.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://nfs.de-fra.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.

## Documentation for API Endpoints

All URIs are relative to *https://nfs.de-fra.ionos.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ClustersApi* | [**ClustersDelete**](docs/api/ClustersApi.md#clustersdelete) | **Delete** /clusters/{clusterId} | Delete Cluster
*ClustersApi* | [**ClustersFindById**](docs/api/ClustersApi.md#clustersfindbyid) | **Get** /clusters/{clusterId} | Retrieve Cluster
*ClustersApi* | [**ClustersGet**](docs/api/ClustersApi.md#clustersget) | **Get** /clusters | Retrieve Clusters
*ClustersApi* | [**ClustersPost**](docs/api/ClustersApi.md#clusterspost) | **Post** /clusters | Create Cluster
*ClustersApi* | [**ClustersPut**](docs/api/ClustersApi.md#clustersput) | **Put** /clusters/{clusterId} | Ensure Cluster
*SharesApi* | [**ClustersSharesDelete**](docs/api/SharesApi.md#clusterssharesdelete) | **Delete** /clusters/{clusterId}/shares/{shareId} | Delete Share
*SharesApi* | [**ClustersSharesFindById**](docs/api/SharesApi.md#clusterssharesfindbyid) | **Get** /clusters/{clusterId}/shares/{shareId} | Retrieve Share
*SharesApi* | [**ClustersSharesGet**](docs/api/SharesApi.md#clusterssharesget) | **Get** /clusters/{clusterId}/shares | Retrieve Shares
*SharesApi* | [**ClustersSharesPost**](docs/api/SharesApi.md#clusterssharespost) | **Post** /clusters/{clusterId}/shares | Create Share
*SharesApi* | [**ClustersSharesPut**](docs/api/SharesApi.md#clusterssharesput) | **Put** /clusters/{clusterId}/shares/{shareId} | Ensure Share
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

In this case, the client configuration needs to be initialized using `NewConfigurationFromEnv()`.

## Documentation For Models
```golang

- [Cluster](docs/models/Cluster.md)
- [ClusterConnections](docs/models/ClusterConnections.md)
- [ClusterCreate](docs/models/ClusterCreate.md)
- [ClusterEnsure](docs/models/ClusterEnsure.md)
- [ClusterNfs](docs/models/ClusterNfs.md)
- [ClusterRead](docs/models/ClusterRead.md)
- [ClusterReadList](docs/models/ClusterReadList.md)
- [ClusterReadListAllOf](docs/models/ClusterReadListAllOf.md)
- [Error](docs/models/Error.md)
- [ErrorMessages](docs/models/ErrorMessages.md)
- [Links](docs/models/Links.md)
- [Metadata](docs/models/Metadata.md)
- [MetadataWithPath](docs/models/MetadataWithPath.md)
- [MetadataWithPathAllOf](docs/models/MetadataWithPathAllOf.md)
- [MetadataWithStatus](docs/models/MetadataWithStatus.md)
- [MetadataWithStatusAllOf](docs/models/MetadataWithStatusAllOf.md)
- [Pagination](docs/models/Pagination.md)
- [Share](docs/models/Share.md)
- [ShareClientGroups](docs/models/ShareClientGroups.md)
- [ShareClientGroupsNfs](docs/models/ShareClientGroupsNfs.md)
- [ShareCreate](docs/models/ShareCreate.md)
- [ShareEnsure](docs/models/ShareEnsure.md)
- [ShareRead](docs/models/ShareRead.md)
- [ShareReadList](docs/models/ShareReadList.md)
- [ShareReadListAllOf](docs/models/ShareReadListAllOf.md)


## Documentation For Authorization


Authentication schemes defined for the API:
### tokenAuth

- **Type**: HTTP Bearer token authentication

Example
client := ionoscloud.NewAPIClient(ionoscloud.NewConfigurationFromEnv())

```golang
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_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://nfs.de-fra.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 |
| ------------- | ------------- | ------------- | ------------- |
| ClustersApi | [**ClustersDelete**](docs/api/ClustersApi.md#ClustersDelete) | **Delete** /clusters/{clusterId} | Delete Cluster |
| ClustersApi | [**ClustersFindById**](docs/api/ClustersApi.md#ClustersFindById) | **Get** /clusters/{clusterId} | Retrieve Cluster |
| ClustersApi | [**ClustersGet**](docs/api/ClustersApi.md#ClustersGet) | **Get** /clusters | Retrieve Clusters |
| ClustersApi | [**ClustersPost**](docs/api/ClustersApi.md#ClustersPost) | **Post** /clusters | Create Cluster |
| ClustersApi | [**ClustersPut**](docs/api/ClustersApi.md#ClustersPut) | **Put** /clusters/{clusterId} | Ensure Cluster |
| SharesApi | [**ClustersSharesDelete**](docs/api/SharesApi.md#ClustersSharesDelete) | **Delete** /clusters/{clusterId}/shares/{shareId} | Delete Share |
| SharesApi | [**ClustersSharesFindById**](docs/api/SharesApi.md#ClustersSharesFindById) | **Get** /clusters/{clusterId}/shares/{shareId} | Retrieve Share |
| SharesApi | [**ClustersSharesGet**](docs/api/SharesApi.md#ClustersSharesGet) | **Get** /clusters/{clusterId}/shares | Retrieve Shares |
| SharesApi | [**ClustersSharesPost**](docs/api/SharesApi.md#ClustersSharesPost) | **Post** /clusters/{clusterId}/shares | Create Share |
| SharesApi | [**ClustersSharesPut**](docs/api/SharesApi.md#ClustersSharesPut) | **Put** /clusters/{clusterId}/shares/{shareId} | Ensure Share |

support@cloud.ionos.com
</details>

## Documentation For Models

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

- [Cluster](docs/models/Cluster)
- [ClusterConnections](docs/models/ClusterConnections)
- [ClusterCreate](docs/models/ClusterCreate)
- [ClusterEnsure](docs/models/ClusterEnsure)
- [ClusterNfs](docs/models/ClusterNfs)
- [ClusterRead](docs/models/ClusterRead)
- [ClusterReadList](docs/models/ClusterReadList)
- [ClusterReadListAllOf](docs/models/ClusterReadListAllOf)
- [Error](docs/models/Error)
- [ErrorMessages](docs/models/ErrorMessages)
- [Links](docs/models/Links)
- [Metadata](docs/models/Metadata)
- [MetadataWithPath](docs/models/MetadataWithPath)
- [MetadataWithPathAllOf](docs/models/MetadataWithPathAllOf)
- [MetadataWithStatus](docs/models/MetadataWithStatus)
- [MetadataWithStatusAllOf](docs/models/MetadataWithStatusAllOf)
- [Pagination](docs/models/Pagination)
- [Share](docs/models/Share)
- [ShareClientGroups](docs/models/ShareClientGroups)
- [ShareClientGroupsNfs](docs/models/ShareClientGroupsNfs)
- [ShareCreate](docs/models/ShareCreate)
- [ShareEnsure](docs/models/ShareEnsure)
- [ShareRead](docs/models/ShareRead)
- [ShareReadList](docs/models/ShareReadList)
- [ShareReadListAllOf](docs/models/ShareReadListAllOf)


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

</details>
11 changes: 10 additions & 1 deletion api_clusters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api_shares.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 32 additions & 2 deletions configuration.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/models/Share.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
|------------ | ------------- | ------------- | -------------|
|**Name** | **string** | The directory being exported | |
|**Quota** | Pointer to **int32** | The quota in MiB for the export. The quota can restrict the amount of data that can be stored within the export. The quota can be disabled using &#x60;0&#x60;. | [optional] [default to 0]|
|**Gid** | Pointer to **int32** | The group ID that will own the exported directory. If not set, **anonymous** (&#x60;512&#x60;) will be used. | [optional] [default to 512]|
|**Uid** | Pointer to **int32** | The user ID that will own the exported directory. If not set, **anonymous** (&#x60;512&#x60;) will be used. | [optional] [default to 512]|
|**Gid** | Pointer to **int32** | The group ID that will own the exported directory and be used as anongid in squash modes root-anonymous and all-anonymous. | [optional] [default to 65534]|
|**Uid** | Pointer to **int32** | The user ID that will own the exported directory and be used as anonuid in squash modes root-anonymous and all-anonymous. | [optional] [default to 65534]|
|**ClientGroups** | [**[]ShareClientGroups**](ShareClientGroups.md) | The groups of clients are the systems connecting to the Network File Storage cluster. | |

## Methods
Expand Down
2 changes: 1 addition & 1 deletion docs/models/ShareClientGroupsNfs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

|Name | Type | Description | Notes|
|------------ | ------------- | ------------- | -------------|
|**Squash** | Pointer to **string** | The squash mode for the export. The squash mode can be: * &#x60;none&#x60; - No squash mode. no mapping * &#x60;root-anonymous&#x60; - Map root user to anonymous uid. * &#x60;all-anonymous&#x60; - Map all users to anonymous uid. | [optional] [default to "none"]|
|**Squash** | Pointer to **string** | The squash mode for the export. The squash mode can be: * &#x60;none&#x60; - No squash mode. no mapping (no_all_squash,no_root_squash). * &#x60;root-anonymous&#x60; - Map root user to anonymous uid (root_squash,anonuid&#x3D;&lt;uid&gt;,anongid&#x3D;&lt;gid&gt;). * &#x60;all-anonymous&#x60; - Map all users to anonymous uid (all_squash,anonuid&#x3D;&lt;uid&gt;,anongid&#x3D;&lt;gid&gt;). | [optional] [default to "none"]|

## Methods

Expand Down
2 changes: 1 addition & 1 deletion logger.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion model_cluster.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion model_cluster_connections.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion model_cluster_create.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e14bd4c

Please sign in to comment.