Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The IONOS Cloud SDK for GO provides you with access to the IONOS Cloud API. The client library supports both simple and complex requests. It is designed for developers who are building applications in GO . The SDK for GO wraps the IONOS Cloud API. All API operations are performed over SSL and authenticated using your IONOS Cloud portal credentials. The API can be accessed within an instance running in IONOS Cloud or directly over the Internet from any application that can send an HTTPS request and receive an HTTPS response.
Before you begin you will need to have signed-up for a IONOS Cloud account. The credentials you setup during sign-up will be used to authenticate against the API.
Install the Go language from from the official Go installation guide.
The GOPATH
environment variable specifies the location of your Go workspace. It is likely the only environment variable you will need to set when developing Go code. This is an example of pointing to a workspace configured under your home directory:
The following go
command will download sdk-go
to your configured GOPATH
:
The source code of the package will be located here:
Create main package file example.go:
Include the IONOS Cloud SDK for Go under the list of imports.
The username and passwod or the authentication token can be manually specified when initializing the sdk client:
Environment variables can also be used. The sdk uses the following variables:
IONOS_USERNAME - to specify the username used to login
IONOS_PASSWORD - to specify the password
IONOS_TOKEN - if an authentication token is being used
IONOS_API_URL - to overwrite the api endpoint: api.ionos.com
- if it is not set, the default value will be used
In this case, the client configuration needs to be initialized using NewConfigurationFromEnv()
Caution: You will want to ensure you follow security best practices when using credentials within your code or stored in a file.
IONOS_USERNAME
Specify the username used to login, to authenticate against the IONOS Cloud API
IONOS_PASSWORD
Specify the password used to login, to authenticate against the IONOS Cloud API
IONOS_TOKEN
Specify the token used to login, if a token is being used instead of username and password
IONOS_API_URL
Specify the API URL. It will overwrite the API endpoint default value api.ionos.com
. Note: the host URL does not contain the /cloudapi/v5
path, so it should not be included in the IONOS_API_URL
environment variable
Many of the List or Get operations will accept an optional depth argument. Setting this to a value between 0 and 5 affects the amount of data that is returned. The details returned vary depending on the resource being queried, however, it generally follows this pattern.
0
Only direct properties are included. Children are not included.
1
Direct properties and children's references are returned.
2
Direct properties and children's properties are returned.
3
Direct properties, children's properties, and descendant's references are returned.
4
Direct properties, children's properties, and descendant's properties are returned.
5
Returns all available properties.
⚠️ Please use this parameter with caution. We recommend using the default value and raising its value only if it is needed.
On the configuration level:
Using this method, the depth parameter will be set on all the API calls.
When calling a method:
Using this method, the depth parameter will be set on the current API call.
Using the default value:
If the depth parameter is not set, it will have the default value from the API that can be found here.
Note: The priority for setting the depth parameter is: set on function call > set on configuration level > set using the default value from the API
The operations will also accept an optional pretty argument. Setting this to a value of true
or false
controls whether response is pretty-printed (with indentation and new lines). By default, the SDK sets the pretty argument to true
.
Changing the base URL for the HTTP operation is possible by using the following function:
The IONOS Cloud SDK for GO aims to offer access to all resources in the IONOS Cloud API and also offers some additional features that make the integration easier:
authentication for API calls
handling of asynchronous requests
How can I open a bug/feature request?
Bugs & feature requests can be open on the repository issues: https://github.com/ionos-cloud/sdk-go/issues/new/choose
Can I contribute to the GO SDK?
Pure SDKs are automatically generated using OpenAPI Generator and don’t support manual changes. If you need changes please open an issue and we’ll try to take care of it.
If you want to see the API call request and response messages, you need to set the Debug field in the Configuration struct:
⚠️ Note: We recommend you only set this field for debugging purposes. Disable it in your production environments because it can log sensitive data. It logs the full request and response without encryption, even for an HTTPS call. Verbose request and response logging can also significantly impact your application’s performance.
Add proxyProtocol
parameter for ALB and NLB targets
Allow setting Host
and Scheme
when creating a client with a serverUrl
(@maxbischoff)
Remove usage of deprecated ioutil
package (@avorima)
Move docs for Url with context to api_doc.mustache
Support injecting x-contract-number
header through environment variable.
Added support for IPv6:
New parameter on DatacenterProperties
: Ipv6CidrBlock
New parameter on LanProperties
and LanPropertiesPost
: Ipv6CidrBlock
New parameters on NicProperties
: Dhcpv6
, Ipv6CidrBlock
and Ipv6Ips
Go client backoff now respects context cancellation
Full Changelog: https://github.com/ionos-cloud/sdk-go/compare/v6.1.7...v6.1.8
New licenceType supported: RHEL
Added generic functions for utility package
Removed swagger
Library dependencies
Added placementGroupId
and vnet
parameters.
Allow multiple values to be set for the same filter key
Fix return type of NewGenericOpenAPIError
Changed from manageDbaas
to manageDBaaS
field in model_group_properties.go
: provides privilege for a group to manage DBaaS related functionality. Admin users already have it enabled by default.
Issue #26
Added manageDbaas
field in model_group_properties.go
: provides privilege for a group to manage DBaaS related functionality. Admin users already here this enabled by default.
Added deleteVolumes
to DatacentersServersDelete
function: If true, all attached storage volumes will also be deleted.
Added bootOrder
to model_volume_properties
: Determines whether the volume will be used as a boot volume. Set to `NONE`, the volume will not be used as boot volume. Set to `PRIMARY`, the volume will be used as boot volume and all other volumes must be set to `NONE`. Set to `AUTO` or `null` requires all volumes to be set to `AUTO` or `null`; this will use the legacy behavior, which is to use the volume as a boot volume only if there are no other volumes or cdrom devices. | [optional] [default to 'AUTO'] |
Added helper function HttpNotFound
in response.go
added Application Load Balancer and Target Group, 18 new models and 2 new apis
new parameter on KubernetesClusterProperties, KubernetesClusterPropertiesForPost: public
new parameter on KubernetesNodePoolProperties, KubernetesNodePoolPropertiesForPost: gatewayIp
allow fields that are explicitly nullable to be sent with null values
updated oauth import
depth parameter:
new method SetDepth on configuration that allows setting a value for the depth parameter on all the API calls for the client
changed the default value of depth parameter from 10 to 0
this affects the amount of data that is returned on GET methods. If there is a need to change the value, please do it with caution and only if it is needed.
changed structure ApiK8sNodepoolsPostRequest
, changed name of kubernetesNodePool
field from KubernetesNodePool
to KubernetesNodePoolForPost
changed structure ApiK8sNodepoolsPutRequest
, changed type of KubernetesNodePoolForPut
field from kubernetesNodePoolForPut
to kubernetesNodePool
fixed sporadic EOF error seen from server
fixed overwriting https with http
for host endpoint that starts with http
. It now allows user to enter a url that starts with http
added Password
field to UserPropertiesPut
to allow user password update
added support for maxResults
query parameter on GET requests
renamed Apis services: LansApi
to LANsApi
renamed BackupUnitProperties
to BackupUnit
on BackupunitsPatch
method
updated descriptions
improved code in sync with Sonar Cloud requirements:
added global constant FilterQueryParam
renamed global constant FORMAT_STRING
to FormatStringErr
added support for filter query parameters on GET requests: Filter()
added support for overwriting the host-url value via IONOS_API_URL
environment variable
added gofmt
check's results
added Offset, Limit and Links to IpBlocks
removed Public parameter from KubernetesClusterProperties
removed GatewayIp parameter from KubernetesNodePoolProperties
added imageAlias to VolumeProperties
added Offset, Limit and Links to User
removed gatewayIp parameter from KubernetesClusterProperties
added GatewayIp parameter from KubernetesNodePoolProperties
All URIs are relative to https://api.ionos.com/cloudapi/v6
Get Contract Information
Other parameters are passed through a pointer to a apiContractsGetRequest struct via the builder pattern
Content-Type: Not defined
Accept: application/json
More details about IPv6 configuration can be found .
Logger interface with log levels for the sdk. Allows user to inject it's own logger that implements Printf. More information