diff --git a/go.mod b/go.mod index cf5c0bc..e6773f6 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,3 @@ module github.com/leaseweb/leaseweb-go-sdk go 1.18 - -require ( - github.com/leaseweb/leaseweb-go-sdk/abuse v0.0.0-20250103145309-1f00547f505c - github.com/leaseweb/leaseweb-go-sdk/aggregationpack v0.0.0-20250103145309-1f00547f505c - github.com/leaseweb/leaseweb-go-sdk/dedicatedserver v0.0.0-20250103145309-1f00547f505c - github.com/leaseweb/leaseweb-go-sdk/dns v0.0.0-20250103145309-1f00547f505c - github.com/leaseweb/leaseweb-go-sdk/invoice v0.0.0-20250103145309-1f00547f505c - github.com/leaseweb/leaseweb-go-sdk/ipmgmt v0.0.0-20250103145656-75b0166e5739 - github.com/leaseweb/leaseweb-go-sdk/publiccloud v0.0.0-20250103145309-1f00547f505c -) - -require gopkg.in/validator.v2 v2.0.1 // indirect diff --git a/go.sum b/go.sum deleted file mode 100644 index 94f3219..0000000 --- a/go.sum +++ /dev/null @@ -1,19 +0,0 @@ -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= -github.com/leaseweb/leaseweb-go-sdk/abuse v0.0.0-20250103145309-1f00547f505c h1:1XdxEYJ9BJmAPgP+5mVF+nyYgVOSzPwIt2gWpHSoklo= -github.com/leaseweb/leaseweb-go-sdk/abuse v0.0.0-20250103145309-1f00547f505c/go.mod h1:VofRmCtVcL3IWjG1IWrlErHm+NWDq7B1tmfDjn58Xg8= -github.com/leaseweb/leaseweb-go-sdk/aggregationpack v0.0.0-20250103145309-1f00547f505c h1:727Mq0sidV0JwzDFr7/rSpo1RTTTO5tCQsfJdqb5iAo= -github.com/leaseweb/leaseweb-go-sdk/aggregationpack v0.0.0-20250103145309-1f00547f505c/go.mod h1:QIKF5Qfot2Yv7/hf/48FDSiL4xGUgPLh1lC+NOVGz58= -github.com/leaseweb/leaseweb-go-sdk/dedicatedserver v0.0.0-20250103145309-1f00547f505c h1:1szcxpEwEgxq+5NtTExLHtmZZhLFlVT+C8YZOCLoQz4= -github.com/leaseweb/leaseweb-go-sdk/dedicatedserver v0.0.0-20250103145309-1f00547f505c/go.mod h1:8c8VAxXnjCxuUEss0Unrd5NB9o7oAkOPeORCs58y76s= -github.com/leaseweb/leaseweb-go-sdk/dns v0.0.0-20250103145309-1f00547f505c h1:5nVDjzHDqdTi/AvxHFHAN+JYduTGQ3vn40kXF0VIrSI= -github.com/leaseweb/leaseweb-go-sdk/dns v0.0.0-20250103145309-1f00547f505c/go.mod h1:ntxqh2fT7XDwjPLNsWtq6tTjwjL/75llxnbzEZvvzIo= -github.com/leaseweb/leaseweb-go-sdk/invoice v0.0.0-20250103145309-1f00547f505c h1:Ekcl9h2azhpOouoPcMrqAU20WNy6FMwYRXEZ1L01G2I= -github.com/leaseweb/leaseweb-go-sdk/invoice v0.0.0-20250103145309-1f00547f505c/go.mod h1:lI/W9zHBEvjaNrF9tiUqDSxaUose3NkI4H+TqqEdR94= -github.com/leaseweb/leaseweb-go-sdk/ipmgmt v0.0.0-20250103145656-75b0166e5739 h1:LwNPADagUNgaaTkCJVU7I8PNMQAU9NZFbfCEXbwgPdk= -github.com/leaseweb/leaseweb-go-sdk/ipmgmt v0.0.0-20250103145656-75b0166e5739/go.mod h1:TeCaVUQAQU2MeaJVJMMGAnuq9r6VKQF3kurB4dfN9HY= -github.com/leaseweb/leaseweb-go-sdk/publiccloud v0.0.0-20250103145309-1f00547f505c h1:Y+1oyL7YdMF5aU6Yzp8s+5YI+jjUtGl6gOUewSdPK08= -github.com/leaseweb/leaseweb-go-sdk/publiccloud v0.0.0-20250103145309-1f00547f505c/go.mod h1:AYJsx8WlHYQXRAzEMuXzuApwIctcLPFazfAo9uy6ogY= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/validator.v2 v2.0.1 h1:xF0KWyGWXm/LM2G1TrEjqOu4pa6coO9AlWSf3msVfDY= -gopkg.in/validator.v2 v2.0.1/go.mod h1:lIUZBlB3Im4s/eYp39Ry/wkR02yOPhZ9IwIRBjuPuG8= diff --git a/publiccloud/.openapi-generator/FILES b/publiccloud/.openapi-generator/FILES index 621d27f..7fe7483 100644 --- a/publiccloud/.openapi-generator/FILES +++ b/publiccloud/.openapi-generator/FILES @@ -33,6 +33,7 @@ docs/CreateImageOpts.md docs/CreateTargetGroupOpts.md docs/Credential.md docs/CredentialType.md +docs/DataTraffic.md docs/DataTrafficMetrics.md docs/DataTransferredMetrics.md docs/Datacenter.md @@ -44,7 +45,7 @@ docs/GetAutoScalingGroupInstanceListResult.md docs/GetAutoScalingGroupListResult.md docs/GetConnectionsMetricsResult.md docs/GetConnectionsPerSecondMetricsResult.md -docs/GetConsoleAccessToInstanceResult.md +docs/GetConsoleAccessResult.md docs/GetCpuMetricsResult.md docs/GetCredentialListByTypeResult.md docs/GetCredentialListResult.md @@ -192,6 +193,7 @@ model_create_image_opts.go model_create_target_group_opts.go model_credential.go model_credential_type.go +model_data_traffic.go model_data_traffic_metrics.go model_data_transferred_metrics.go model_datacenter.go @@ -203,7 +205,7 @@ model_get_auto_scaling_group_instance_list_result.go model_get_auto_scaling_group_list_result.go model_get_connections_metrics_result.go model_get_connections_per_second_metrics_result.go -model_get_console_access_to_instance_result.go +model_get_console_access_result.go model_get_cpu_metrics_result.go model_get_credential_list_by_type_result.go model_get_credential_list_result.go diff --git a/publiccloud/README.md b/publiccloud/README.md index f29a5d4..71f9369 100644 --- a/publiccloud/README.md +++ b/publiccloud/README.md @@ -88,17 +88,19 @@ Class | Method | HTTP request | Description *PubliccloudAPI* | [**CancelInstanceTermination**](docs/PubliccloudAPI.md#cancelinstancetermination) | **Post** /instances/{instanceId}/cancelTermination | Cancel instance termination *PubliccloudAPI* | [**CreateAutoScalingGroup**](docs/PubliccloudAPI.md#createautoscalinggroup) | **Post** /autoScalingGroups | Create Auto Scaling Group *PubliccloudAPI* | [**CreateImage**](docs/PubliccloudAPI.md#createimage) | **Post** /images | Create Custom Image +*PubliccloudAPI* | [**CreateInstanceSnapshot**](docs/PubliccloudAPI.md#createinstancesnapshot) | **Post** /instances/{instanceId}/snapshots | Create instance snapshot *PubliccloudAPI* | [**CreateLoadBalancerListener**](docs/PubliccloudAPI.md#createloadbalancerlistener) | **Post** /loadBalancers/{loadBalancerId}/listeners | Create listener -*PubliccloudAPI* | [**CreateSnapshot**](docs/PubliccloudAPI.md#createsnapshot) | **Post** /instances/{instanceId}/snapshots | Create instance snapshot *PubliccloudAPI* | [**CreateTargetGroup**](docs/PubliccloudAPI.md#createtargetgroup) | **Post** /targetGroups | Create Target Group +*PubliccloudAPI* | [**CreateVPSSnapshot**](docs/PubliccloudAPI.md#createvpssnapshot) | **Post** /vps/{vpsId}/snapshots | Create VPS snapshot *PubliccloudAPI* | [**DeleteAutoScalingGroup**](docs/PubliccloudAPI.md#deleteautoscalinggroup) | **Delete** /autoScalingGroups/{autoScalingGroupId} | Delete Auto Scaling Group *PubliccloudAPI* | [**DeleteInstanceCredential**](docs/PubliccloudAPI.md#deleteinstancecredential) | **Delete** /instances/{instanceId}/credentials/{type}/{username} | Delete Instance credential for a given type and username *PubliccloudAPI* | [**DeleteInstanceCredentials**](docs/PubliccloudAPI.md#deleteinstancecredentials) | **Delete** /instances/{instanceId}/credentials | Delete all credentials associated with a specific Instance +*PubliccloudAPI* | [**DeleteInstanceSnapshot**](docs/PubliccloudAPI.md#deleteinstancesnapshot) | **Delete** /instances/{instanceId}/snapshots/{snapshotId} | Delete instance snapshot *PubliccloudAPI* | [**DeleteLoadBalancerListener**](docs/PubliccloudAPI.md#deleteloadbalancerlistener) | **Delete** /loadBalancers/{loadBalancerId}/listeners/{listenerId} | Delete load balancer listener -*PubliccloudAPI* | [**DeleteSnapshot**](docs/PubliccloudAPI.md#deletesnapshot) | **Delete** /instances/{instanceId}/snapshots/{snapshotId} | Delete instance snapshot *PubliccloudAPI* | [**DeleteTargetGroup**](docs/PubliccloudAPI.md#deletetargetgroup) | **Delete** /targetGroups/{targetGroupId} | Delete Target Group *PubliccloudAPI* | [**DeleteVPSCredential**](docs/PubliccloudAPI.md#deletevpscredential) | **Delete** /vps/{vpsId}/credentials/{type}/{username} | Delete VPS credential *PubliccloudAPI* | [**DeleteVPSCredentials**](docs/PubliccloudAPI.md#deletevpscredentials) | **Delete** /vps/{vpsId}/credentials | Delete all credentials associated with a specific VPS +*PubliccloudAPI* | [**DeleteVPSSnapshot**](docs/PubliccloudAPI.md#deletevpssnapshot) | **Delete** /vps/{vpsId}/snapshots/{snapshotId} | Delete VPS snapshot *PubliccloudAPI* | [**DeregisterAutoScalingGroupTargetGroup**](docs/PubliccloudAPI.md#deregisterautoscalinggrouptargetgroup) | **Post** /autoScalingGroups/{autoScalingGroupId}/deregisterTargetGroup | Deregister Target Group *PubliccloudAPI* | [**DeregisterTargets**](docs/PubliccloudAPI.md#deregistertargets) | **Post** /targetGroups/{targetGroupId}/deregisterTargets | Deregister Targets *PubliccloudAPI* | [**DetachInstanceISO**](docs/PubliccloudAPI.md#detachinstanceiso) | **Post** /instances/{instanceId}/detachIso | Detach ISO from a specific Instance @@ -108,13 +110,13 @@ Class | Method | HTTP request | Description *PubliccloudAPI* | [**GetAutoScalingGroupList**](docs/PubliccloudAPI.md#getautoscalinggrouplist) | **Get** /autoScalingGroups | Get Auto Scaling Group list *PubliccloudAPI* | [**GetConnectionsMetrics**](docs/PubliccloudAPI.md#getconnectionsmetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/connections | Get connections metrics *PubliccloudAPI* | [**GetConnectionsPerSecondMetrics**](docs/PubliccloudAPI.md#getconnectionspersecondmetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/connectionsPerSecond | Get connections per second metrics -*PubliccloudAPI* | [**GetConsoleAccessToInstance**](docs/PubliccloudAPI.md#getconsoleaccesstoinstance) | **Get** /instances/{instanceId}/console | Get console access *PubliccloudAPI* | [**GetCpuMetrics**](docs/PubliccloudAPI.md#getcpumetrics) | **Get** /instances/{instanceId}/metrics/cpu | Get instance CPU metrics *PubliccloudAPI* | [**GetDataTransferredMetrics**](docs/PubliccloudAPI.md#getdatatransferredmetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/dataTransferred | Get load balancer data transferred metrics *PubliccloudAPI* | [**GetDataTransferredPerSecondMetrics**](docs/PubliccloudAPI.md#getdatatransferredpersecondmetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/dataTransferredPerSecond | Get load balancer data transferred per second metrics *PubliccloudAPI* | [**GetExpenses**](docs/PubliccloudAPI.md#getexpenses) | **Get** /equipments/{equipmentId}/expenses | Get costs for a given month. *PubliccloudAPI* | [**GetImageList**](docs/PubliccloudAPI.md#getimagelist) | **Get** /images | List all available Images *PubliccloudAPI* | [**GetInstance**](docs/PubliccloudAPI.md#getinstance) | **Get** /instances/{instanceId} | Get instance details +*PubliccloudAPI* | [**GetInstanceConsoleAccess**](docs/PubliccloudAPI.md#getinstanceconsoleaccess) | **Get** /instances/{instanceId}/console | Get console access *PubliccloudAPI* | [**GetInstanceCredential**](docs/PubliccloudAPI.md#getinstancecredential) | **Get** /instances/{instanceId}/credentials/{type}/{username} | Get Instance credentials by type and username. *PubliccloudAPI* | [**GetInstanceCredentialList**](docs/PubliccloudAPI.md#getinstancecredentiallist) | **Get** /instances/{instanceId}/credentials | List credentials stored for a specific Instance *PubliccloudAPI* | [**GetInstanceCredentialListByType**](docs/PubliccloudAPI.md#getinstancecredentiallistbytype) | **Get** /instances/{instanceId}/credentials/{type} | Get credentials by type for a specific Instance @@ -122,6 +124,8 @@ Class | Method | HTTP request | Description *PubliccloudAPI* | [**GetInstanceIP**](docs/PubliccloudAPI.md#getinstanceip) | **Get** /instances/{instanceId}/ips/{ip} | Get IP details for a specific Instance *PubliccloudAPI* | [**GetInstanceIPList**](docs/PubliccloudAPI.md#getinstanceiplist) | **Get** /instances/{instanceId}/ips | List IP addresses associated with a specific Instance *PubliccloudAPI* | [**GetInstanceList**](docs/PubliccloudAPI.md#getinstancelist) | **Get** /instances | Get instance list +*PubliccloudAPI* | [**GetInstanceSnapshot**](docs/PubliccloudAPI.md#getinstancesnapshot) | **Get** /instances/{instanceId}/snapshots/{snapshotId} | Get snapshot detail +*PubliccloudAPI* | [**GetInstanceSnapshotList**](docs/PubliccloudAPI.md#getinstancesnapshotlist) | **Get** /instances/{instanceId}/snapshots | List snapshots *PubliccloudAPI* | [**GetInstanceTypeList**](docs/PubliccloudAPI.md#getinstancetypelist) | **Get** /instanceTypes | List instance types *PubliccloudAPI* | [**GetIsoList**](docs/PubliccloudAPI.md#getisolist) | **Get** /isos | List available ISOs *PubliccloudAPI* | [**GetLoadBalancer**](docs/PubliccloudAPI.md#getloadbalancer) | **Get** /loadBalancers/{loadBalancerId} | Get load balancer details @@ -139,18 +143,19 @@ Class | Method | HTTP request | Description *PubliccloudAPI* | [**GetRequestsPerSecondMetrics**](docs/PubliccloudAPI.md#getrequestspersecondmetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/requestsPerSecond | Get load balancer requests per second metrics *PubliccloudAPI* | [**GetResponseCodesMetrics**](docs/PubliccloudAPI.md#getresponsecodesmetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/responseCodes | Get response codes metrics *PubliccloudAPI* | [**GetResponseCodesPerSecondMetrics**](docs/PubliccloudAPI.md#getresponsecodespersecondmetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/responseCodesPerSecond | Get response codes per second metrics -*PubliccloudAPI* | [**GetSnapshot**](docs/PubliccloudAPI.md#getsnapshot) | **Get** /instances/{instanceId}/snapshots/{snapshotId} | Get snapshot detail -*PubliccloudAPI* | [**GetSnapshotList**](docs/PubliccloudAPI.md#getsnapshotlist) | **Get** /instances/{instanceId}/snapshots | List snapshots *PubliccloudAPI* | [**GetTargetGroup**](docs/PubliccloudAPI.md#gettargetgroup) | **Get** /targetGroups/{targetGroupId} | Get Target Group details *PubliccloudAPI* | [**GetTargetGroupList**](docs/PubliccloudAPI.md#gettargetgrouplist) | **Get** /targetGroups | Get Target Group list *PubliccloudAPI* | [**GetTargetList**](docs/PubliccloudAPI.md#gettargetlist) | **Get** /targetGroups/{targetGroupId}/targets | Get Targets *PubliccloudAPI* | [**GetUpdateInstanceTypeList**](docs/PubliccloudAPI.md#getupdateinstancetypelist) | **Get** /instances/{instanceId}/instanceTypesUpdate | List available instance types for update +*PubliccloudAPI* | [**GetVPSConsoleAccess**](docs/PubliccloudAPI.md#getvpsconsoleaccess) | **Get** /vps/{vpsId}/console | Get console access *PubliccloudAPI* | [**GetVPSCredential**](docs/PubliccloudAPI.md#getvpscredential) | **Get** /vps/{vpsId}/credentials/{type}/{username} | Get VPS credential by type and username. *PubliccloudAPI* | [**GetVPSCredentialList**](docs/PubliccloudAPI.md#getvpscredentiallist) | **Get** /vps/{vpsId}/credentials | List credentials stored for a specific VPS *PubliccloudAPI* | [**GetVPSCredentialListByType**](docs/PubliccloudAPI.md#getvpscredentiallistbytype) | **Get** /vps/{vpsId}/credentials/{type} | Get credentials by type for a specific VPS *PubliccloudAPI* | [**GetVPSDataTrafficMetrics**](docs/PubliccloudAPI.md#getvpsdatatrafficmetrics) | **Get** /vps/{vpsId}/metrics/datatraffic | Get data traffic metrics for a specific VPS *PubliccloudAPI* | [**GetVPSIP**](docs/PubliccloudAPI.md#getvpsip) | **Get** /vps/{vpsId}/ips/{ip} | Get IP details for a specific VPS *PubliccloudAPI* | [**GetVPSIPList**](docs/PubliccloudAPI.md#getvpsiplist) | **Get** /vps/{vpsId}/ips | List IP addresses associated with a specific VPS +*PubliccloudAPI* | [**GetVPSSnapshot**](docs/PubliccloudAPI.md#getvpssnapshot) | **Get** /vps/{vpsId}/snapshots/{snapshotId} | Get snapshot detail +*PubliccloudAPI* | [**GetVPSSnapshotList**](docs/PubliccloudAPI.md#getvpssnapshotlist) | **Get** /vps/{vpsId}/snapshots | List snapshots *PubliccloudAPI* | [**GetVps**](docs/PubliccloudAPI.md#getvps) | **Get** /vps/{vpsId} | Get VPS details *PubliccloudAPI* | [**GetVpsList**](docs/PubliccloudAPI.md#getvpslist) | **Get** /vps | Get VPS list *PubliccloudAPI* | [**LaunchInstance**](docs/PubliccloudAPI.md#launchinstance) | **Post** /instances | Launch instance @@ -171,10 +176,11 @@ Class | Method | HTTP request | Description *PubliccloudAPI* | [**RemoveVPSIPNullRoute**](docs/PubliccloudAPI.md#removevpsipnullroute) | **Post** /vps/{vpsId}/ips/{ip}/unnull | Remove an IP null route for a specific VPS *PubliccloudAPI* | [**ResetInstancePassword**](docs/PubliccloudAPI.md#resetinstancepassword) | **Post** /instances/{instanceId}/resetPassword | Reset the password for a specific Instance *PubliccloudAPI* | [**ResetVPSPassword**](docs/PubliccloudAPI.md#resetvpspassword) | **Post** /vps/{vpsId}/resetPassword | Reset the password for a specific VPS -*PubliccloudAPI* | [**RestoreSnapshot**](docs/PubliccloudAPI.md#restoresnapshot) | **Put** /instances/{instanceId}/snapshots/{snapshotId} | Restore instance snapshot +*PubliccloudAPI* | [**RestoreInstanceSnapshot**](docs/PubliccloudAPI.md#restoreinstancesnapshot) | **Put** /instances/{instanceId}/snapshots/{snapshotId} | Restore instance snapshot +*PubliccloudAPI* | [**RestoreVPSSnapshot**](docs/PubliccloudAPI.md#restorevpssnapshot) | **Put** /vps/{vpsId}/snapshots/{snapshotId} | Restore VPS snapshot *PubliccloudAPI* | [**StartInstance**](docs/PubliccloudAPI.md#startinstance) | **Post** /instances/{instanceId}/start | Start a specific resource Instance *PubliccloudAPI* | [**StartLoadBalancer**](docs/PubliccloudAPI.md#startloadbalancer) | **Post** /loadBalancers/{loadBalancerId}/start | Start a specific resource Load Balancer -*PubliccloudAPI* | [**StartVPS**](docs/PubliccloudAPI.md#startvps) | **Post** /vps/{vpsId}/start | Start a specific resource VPS +*PubliccloudAPI* | [**StartVPS**](docs/PubliccloudAPI.md#startvps) | **Post** /vps/{vpsId}/start | Start a specific VPS *PubliccloudAPI* | [**StopInstance**](docs/PubliccloudAPI.md#stopinstance) | **Post** /instances/{instanceId}/stop | Stop a specific Instance *PubliccloudAPI* | [**StopLoadBalancer**](docs/PubliccloudAPI.md#stoploadbalancer) | **Post** /loadBalancers/{loadBalancerId}/stop | Stop a specific Load Balancer *PubliccloudAPI* | [**StopVPS**](docs/PubliccloudAPI.md#stopvps) | **Post** /vps/{vpsId}/stop | Stop a specific VPS @@ -224,6 +230,7 @@ Class | Method | HTTP request | Description - [CreateTargetGroupOpts](docs/CreateTargetGroupOpts.md) - [Credential](docs/Credential.md) - [CredentialType](docs/CredentialType.md) + - [DataTraffic](docs/DataTraffic.md) - [DataTrafficMetrics](docs/DataTrafficMetrics.md) - [DataTransferredMetrics](docs/DataTransferredMetrics.md) - [Datacenter](docs/Datacenter.md) @@ -235,7 +242,7 @@ Class | Method | HTTP request | Description - [GetAutoScalingGroupListResult](docs/GetAutoScalingGroupListResult.md) - [GetConnectionsMetricsResult](docs/GetConnectionsMetricsResult.md) - [GetConnectionsPerSecondMetricsResult](docs/GetConnectionsPerSecondMetricsResult.md) - - [GetConsoleAccessToInstanceResult](docs/GetConsoleAccessToInstanceResult.md) + - [GetConsoleAccessResult](docs/GetConsoleAccessResult.md) - [GetCpuMetricsResult](docs/GetCpuMetricsResult.md) - [GetCredentialListByTypeResult](docs/GetCredentialListByTypeResult.md) - [GetCredentialListResult](docs/GetCredentialListResult.md) diff --git a/publiccloud/api/openapi.yaml b/publiccloud/api/openapi.yaml index af5422d..11e4e25 100644 --- a/publiccloud/api/openapi.yaml +++ b/publiccloud/api/openapi.yaml @@ -1722,13 +1722,12 @@ paths: operationId: startVPS parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple responses: @@ -1796,7 +1795,7 @@ paths: schema: $ref: '#/components/schemas/errorResult' description: Service Unavailable. - summary: Start a specific resource VPS + summary: Start a specific VPS tags: - publiccloud /instances/{instanceId}/stop: @@ -1971,13 +1970,12 @@ paths: operationId: stopVPS parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple responses: @@ -2220,13 +2218,12 @@ paths: operationId: rebootVPS parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple responses: @@ -2300,7 +2297,7 @@ paths: /instances/{instanceId}/console: get: description: Get console access to the instance - operationId: getConsoleAccessToInstance + operationId: getInstanceConsoleAccess parameters: - description: Instance's ID example: ace712e9-a166-47f1-9065-4af0f7e7fce1 @@ -2319,7 +2316,94 @@ paths: example: url: https://public-cloud.leaseweb.com/resource/noVNC/vnc.html?autoconnect=true&port=8080&token=dvoPyDxbBl8LC9OsXI55CmAUmUA50lY19b0/v/7jrA6VkrdflVWw8S2XuxDZrBaaSo4XdBAYmpfqC0kUr2aOVHjMlGFb6movdnKNxvMOEmC0spwU9XbdZJrWXzGicCLT4X4GMxgN13nn1oDQb8k9ag2rMMxENyiPZ3bbV1iGuL4cWLEMad8hHFXjJ7P2MvbnpiasXK5wKuHadrR76778ZM22xxzvjarg9S6bAWziH1u3VdKIQyJMIrDmAdjYRqL1IHqrN+uLrY6WPzv+s51lnNYd0zeQtB7YWBZup8VDcZSt5C0GrYnZx3Vh4fXWOOsFlWZgdEGKf9oM9y9RX2G/jLlVeVv4LmVCN02GRr7SAfyx8WcuWGXS7WsxpXTzdxWEm9EMZDrPQhFiZKo20PXRdgT6KbdnqCI/j8z5iPAKGO3YI5BcK5sUdhHgFUMNgJUw/qhz71/xivIP8UKrWVgZMRWXmt6hNWIeHLqrdZ0n5m9It4Os8UaKgeBvwlFTpzNTUWxvoI0+2sa8GAmW3RCe9mfK3xvW/iy1MZ651cALLVmoj6imZl7K7P33iQ== schema: - $ref: '#/components/schemas/getConsoleAccessToInstanceResult' + $ref: '#/components/schemas/getConsoleAccessResult' + description: OK. + "400": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "400" + errorDetails: {} + errorMessage: The API could not interpret your request correctly. + schema: + $ref: '#/components/schemas/errorResult' + description: Bad Request. + "401": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "401" + errorMessage: You are not authorized to view this resource. + schema: + $ref: '#/components/schemas/errorResult' + description: Not Authorized. + "403": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "403" + errorMessage: Access to the requested resource is forbidden. + schema: + $ref: '#/components/schemas/errorResult' + description: Forbidden. + "404": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "404" + errorMessage: Resource not found + schema: + $ref: '#/components/schemas/errorResult' + description: Not Found. + "500": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "500" + errorMessage: '''The API could not handle your request at this time.' + schema: + $ref: '#/components/schemas/errorResult' + description: Internal Server Error. + "503": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "503" + errorMessage: The API is not available at the moment. + schema: + $ref: '#/components/schemas/errorResult' + description: Service Unavailable. + summary: Get console access + tags: + - publiccloud + /vps/{vpsId}/console: + get: + description: Get console access to the VPS + operationId: getVPSConsoleAccess + parameters: + - description: VPS ID + example: "999999999" + explode: false + in: path + name: vpsId + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + url: https://public-cloud.leaseweb.com/resource/noVNC/vnc.html?autoconnect=true&port=8080&token=dvoPyDxbBl8LC9OsXI55CmAUmUA50lY19b0/v/7jrA6VkrdflVWw8S2XuxDZrBaaSo4XdBAYmpfqC0kUr2aOVHjMlGFb6movdnKNxvMOEmC0spwU9XbdZJrWXzGicCLT4X4GMxgN13nn1oDQb8k9ag2rMMxENyiPZ3bbV1iGuL4cWLEMad8hHFXjJ7P2MvbnpiasXK5wKuHadrR76778ZM22xxzvjarg9S6bAWziH1u3VdKIQyJMIrDmAdjYRqL1IHqrN+uLrY6WPzv+s51lnNYd0zeQtB7YWBZup8VDcZSt5C0GrYnZx3Vh4fXWOOsFlWZgdEGKf9oM9y9RX2G/jLlVeVv4LmVCN02GRr7SAfyx8WcuWGXS7WsxpXTzdxWEm9EMZDrPQhFiZKo20PXRdgT6KbdnqCI/j8z5iPAKGO3YI5BcK5sUdhHgFUMNgJUw/qhz71/xivIP8UKrWVgZMRWXmt6hNWIeHLqrdZ0n5m9It4Os8UaKgeBvwlFTpzNTUWxvoI0+2sa8GAmW3RCe9mfK3xvW/iy1MZ651cALLVmoj6imZl7K7P33iQ== + schema: + $ref: '#/components/schemas/getConsoleAccessResult' description: OK. "400": content: @@ -3029,13 +3113,12 @@ paths: operationId: deleteVPSCredentials parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple responses: @@ -3098,13 +3181,12 @@ paths: operationId: getVPSCredentialList parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple responses: @@ -3179,13 +3261,12 @@ paths: operationId: storeVPSCredential parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple requestBody: @@ -3379,13 +3460,12 @@ paths: operationId: getVPSCredentialListByType parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple - description: Type of credential @@ -3480,13 +3560,12 @@ paths: operationId: deleteVPSCredential parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple - description: Type of credential @@ -3566,13 +3645,12 @@ paths: operationId: getVPSCredential parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple - description: Type of credential @@ -3671,13 +3749,12 @@ paths: operationId: updateVpsCredential parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple - description: Type of credential @@ -4180,13 +4257,12 @@ paths: operationId: resetVPSPassword parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple responses: @@ -5099,13 +5175,12 @@ paths: operationId: attachVPSISO parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple requestBody: @@ -5273,13 +5348,12 @@ paths: operationId: detachVPSISO parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple responses: @@ -5589,13 +5663,12 @@ paths: operationId: getReinstallVPSImageList parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple - description: Limit the number of results returned. @@ -5930,13 +6003,12 @@ paths: operationId: reinstallVPS parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple requestBody: @@ -7616,13 +7688,12 @@ paths: operationId: getVPSIPList parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple - explode: true @@ -8142,13 +8213,12 @@ paths: operationId: getVPSIP parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple - explode: false @@ -8236,13 +8306,12 @@ paths: operationId: updateVPSIP parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple - explode: false @@ -8589,13 +8658,12 @@ paths: operationId: nullRouteVPSIP parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple - explode: false @@ -8919,13 +8987,12 @@ paths: operationId: removeVPSIPNullRoute parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple - explode: false @@ -9344,13 +9411,12 @@ paths: operationId: getVPSDataTrafficMetrics parameters: - description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple - description: The start of the interval to get the metric @@ -11382,7 +11448,7 @@ paths: /instances/{instanceId}/snapshots: get: description: List instance snapshots - operationId: getSnapshotList + operationId: getInstanceSnapshotList parameters: - description: Instance's ID example: ace712e9-a166-47f1-9065-4af0f7e7fce1 @@ -11489,7 +11555,7 @@ paths: The time taken to create the snapshot depends on several factors, including memory size and usage. Allowed only one snapshot per instance. - operationId: createSnapshot + operationId: createInstanceSnapshot parameters: - description: Instance's ID example: ace712e9-a166-47f1-9065-4af0f7e7fce1 @@ -11571,7 +11637,7 @@ paths: - publiccloud /instances/{instanceId}/snapshots/{snapshotId}: delete: - operationId: deleteSnapshot + operationId: deleteInstanceSnapshot parameters: - description: Instance's ID example: ace712e9-a166-47f1-9065-4af0f7e7fce1 @@ -11593,8 +11659,8 @@ paths: style: simple responses: "202": - description: Request has been accepted and instance and snapshot is going - to be deleted. Its current state can be checked using the snapshots endpoints. + description: Request has been accepted and snapshot is going to be deleted. + Its current state can be checked using the snapshots endpoints. "400": content: application/json: @@ -11660,7 +11726,7 @@ paths: tags: - publiccloud get: - operationId: getSnapshot + operationId: getInstanceSnapshot parameters: - description: Instance's ID example: ace712e9-a166-47f1-9065-4af0f7e7fce1 @@ -11746,7 +11812,7 @@ paths: tags: - publiccloud put: - operationId: restoreSnapshot + operationId: restoreInstanceSnapshot parameters: - description: Instance's ID example: ace712e9-a166-47f1-9065-4af0f7e7fce1 @@ -11768,8 +11834,8 @@ paths: style: simple responses: "202": - description: Request has been accepted and instance and snapshot is going - to be restored to instance soon. + description: Request has been accepted and snapshot is going to be restored + to instance soon. "400": content: application/json: @@ -11834,11 +11900,20 @@ paths: summary: Restore instance snapshot tags: - publiccloud - /autoScalingGroups: + /vps/{vpsId}/snapshots: get: - description: List and filter Auto Scaling Groups - operationId: getAutoScalingGroupList + description: List VPS snapshots + operationId: getVPSSnapshotList parameters: + - description: VPS ID + example: "999999999" + explode: false + in: path + name: vpsId + required: true + schema: + type: string + style: simple - description: Limit the number of results returned. example: 20 explode: true @@ -11857,128 +11932,569 @@ paths: schema: type: integer style: form - - example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 - explode: true - in: query - name: id - required: false - schema: - format: uuid - type: string - style: form - - example: 6762182e-7ae9-4d0b-b3b7-bea5a49b3f94 - explode: true - in: query - name: instanceId - required: false - schema: - format: uuid - type: string - style: form - - description: The Auto Scaling Group's type - explode: true - in: query - name: type - required: false - schema: - enum: - - MANUAL - - SCHEDULED - - CPU_BASED - type: string - style: form - - description: The region in which the Auto Scaling Group was created - example: eu-west-3 - explode: true - in: query - name: region - required: false - schema: - $ref: '#/components/schemas/regionName' - style: form - - description: The reference used to identify identifies the Auto Scaling Group - explode: true - in: query - name: reference - required: false - schema: - type: string - style: form - - description: The Auto Scaling Group's current state - explode: true - in: query - name: state - required: false - schema: - enum: - - ACTIVE - - CREATING - - CREATED - - DESTROYED - - DESTROYING - - SCALING - - UPDATING - type: string - style: form responses: "200": content: application/json: example: _metadata: - totalCount: 3 - limit: 10 + totalCount: 1 + limit: 20 offset: 0 - autoScalingGroups: - - id: fb769dab-3daa-47e4-89ed-06a4b6499176 - type: MANUAL - state: ACTIVE - desiredAmount: 2 - minimumAmount: null - maximumAmount: null - cpuThreshold: null - warmupTime: null - cooldownTime: null - region: eu-west-3 - reference: Manual Auto Scaling Group - createdAt: 2024-04-26T09:22:25+00:00 - updatedAt: 2024-04-26T09:22:25+00:00 - startsAt: null - endsAt: null - - id: aa0f2138-3a83-46fe-bdcf-1ad231f94a26 - type: SCHEDULED - state: SCALING - desiredAmount: 2 - minimumAmount: null - maximumAmount: null - cpuThreshold: null - cooldownTime: null - warmupTime: null - region: eu-west-3 - reference: Scheduled Auto Scaling Group - createdAt: 2024-05-13T15:49:52+00:00 - updatedAt: 2024-05-13T15:49:52+00:00 - startsAt: 2024-05-01T08:00:00+00:00 - endsAt: 2024-05-01T12:00:00+00:00 - - id: 49e28a6c-3f2a-442e-b3b1-981856d21677 - type: CPU_BASED - state: CREATING - desiredAmount: 1 - minimumAmount: 1 - maximumAmount: 3 - cpuThreshold: 50 - warmupTime: 300 - cooldownTime: 300 - region: eu-west-3 - reference: CPU Based Auto Scaling Group - createdAt: 2024-05-13T15:49:52+00:00 - updatedAt: 2024-05-13T15:49:52+00:00 - startsAt: null - endsAt: null + snapshots: + - id: 624c53c3-48e9-41d1-833f-90a9abf5fd95 + displayName: snapshot 1 + state: READY + created: 2023-11-02T07:31:28+0000 schema: - $ref: '#/components/schemas/getAutoScalingGroupListResult' - description: OK - "400": + $ref: '#/components/schemas/getSnapshotListResult' + description: OK. + "401": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "401" + errorMessage: You are not authorized to view this resource. + schema: + $ref: '#/components/schemas/errorResult' + description: Not Authorized. + "403": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "403" + errorMessage: Access to the requested resource is forbidden. + schema: + $ref: '#/components/schemas/errorResult' + description: Forbidden. + "404": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "404" + errorMessage: Resource not found + schema: + $ref: '#/components/schemas/errorResult' + description: Not Found. + "500": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "500" + errorMessage: '''The API could not handle your request at this time.' + schema: + $ref: '#/components/schemas/errorResult' + description: Internal Server Error. + "503": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "503" + errorMessage: The API is not available at the moment. + schema: + $ref: '#/components/schemas/errorResult' + description: Service Unavailable. + summary: List snapshots + tags: + - publiccloud + post: + description: |- + The VPS must be running before the execution. + + The time taken to create the snapshot depends on several factors, including memory size and usage. + + Allowed only one snapshot per VPS. + operationId: createVPSSnapshot + parameters: + - description: VPS ID + example: "999999999" + explode: false + in: path + name: vpsId + required: true + schema: + type: string + style: simple + responses: + "202": + description: Request has been accepted and snapshot is going to be ready + soon. + "400": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "400" + errorDetails: {} + errorMessage: The API could not interpret your request correctly. + schema: + $ref: '#/components/schemas/errorResult' + description: Bad Request. + "401": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "401" + errorMessage: You are not authorized to view this resource. + schema: + $ref: '#/components/schemas/errorResult' + description: Not Authorized. + "403": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "403" + errorMessage: Access to the requested resource is forbidden. + schema: + $ref: '#/components/schemas/errorResult' + description: Forbidden. + "404": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "404" + errorMessage: Resource not found + schema: + $ref: '#/components/schemas/errorResult' + description: Not Found. + "500": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "500" + errorMessage: '''The API could not handle your request at this time.' + schema: + $ref: '#/components/schemas/errorResult' + description: Internal Server Error. + "503": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "503" + errorMessage: The API is not available at the moment. + schema: + $ref: '#/components/schemas/errorResult' + description: Service Unavailable. + summary: Create VPS snapshot + tags: + - publiccloud + /vps/{vpsId}/snapshots/{snapshotId}: + delete: + operationId: deleteVPSSnapshot + parameters: + - description: VPS ID + example: "999999999" + explode: false + in: path + name: vpsId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: snapshotId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "202": + description: Request has been accepted and snapshot is going to be deleted. + Its current state can be checked using the snapshots endpoints. + "400": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "400" + errorDetails: {} + errorMessage: The API could not interpret your request correctly. + schema: + $ref: '#/components/schemas/errorResult' + description: Bad Request. + "401": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "401" + errorMessage: You are not authorized to view this resource. + schema: + $ref: '#/components/schemas/errorResult' + description: Not Authorized. + "403": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "403" + errorMessage: Access to the requested resource is forbidden. + schema: + $ref: '#/components/schemas/errorResult' + description: Forbidden. + "404": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "404" + errorMessage: Resource not found + schema: + $ref: '#/components/schemas/errorResult' + description: Not Found. + "500": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "500" + errorMessage: '''The API could not handle your request at this time.' + schema: + $ref: '#/components/schemas/errorResult' + description: Internal Server Error. + "503": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "503" + errorMessage: The API is not available at the moment. + schema: + $ref: '#/components/schemas/errorResult' + description: Service Unavailable. + summary: Delete VPS snapshot + tags: + - publiccloud + get: + operationId: getVPSSnapshot + parameters: + - description: VPS ID + example: "999999999" + explode: false + in: path + name: vpsId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: snapshotId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "200": + content: + application/json: + example: + created: 2023-11-02T07:31:28+0000 + displayName: snapshot 1 + id: ef73e9e2-95cd-49ef-940f-a24e6ad6c4a0 + state: READY + schema: + $ref: '#/components/schemas/snapshot' + description: OK. + "401": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "401" + errorMessage: You are not authorized to view this resource. + schema: + $ref: '#/components/schemas/errorResult' + description: Not Authorized. + "403": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "403" + errorMessage: Access to the requested resource is forbidden. + schema: + $ref: '#/components/schemas/errorResult' + description: Forbidden. + "404": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "404" + errorMessage: Resource not found + schema: + $ref: '#/components/schemas/errorResult' + description: Not Found. + "500": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "500" + errorMessage: '''The API could not handle your request at this time.' + schema: + $ref: '#/components/schemas/errorResult' + description: Internal Server Error. + "503": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "503" + errorMessage: The API is not available at the moment. + schema: + $ref: '#/components/schemas/errorResult' + description: Service Unavailable. + summary: Get snapshot detail + tags: + - publiccloud + put: + operationId: restoreVPSSnapshot + parameters: + - description: VPS ID + example: "999999999" + explode: false + in: path + name: vpsId + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: snapshotId + required: true + schema: + format: uuid + type: string + style: simple + responses: + "202": + description: Request has been accepted and snapshot is going to be restored + to VPS soon. + "400": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "400" + errorDetails: {} + errorMessage: The API could not interpret your request correctly. + schema: + $ref: '#/components/schemas/errorResult' + description: Bad Request. + "401": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "401" + errorMessage: You are not authorized to view this resource. + schema: + $ref: '#/components/schemas/errorResult' + description: Not Authorized. + "403": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "403" + errorMessage: Access to the requested resource is forbidden. + schema: + $ref: '#/components/schemas/errorResult' + description: Forbidden. + "404": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "404" + errorMessage: Resource not found + schema: + $ref: '#/components/schemas/errorResult' + description: Not Found. + "500": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "500" + errorMessage: '''The API could not handle your request at this time.' + schema: + $ref: '#/components/schemas/errorResult' + description: Internal Server Error. + "503": + content: + application/json: + example: + correlationId: 289346a1-3eaf-4da4-b707-62ef12eb08be + errorCode: "503" + errorMessage: The API is not available at the moment. + schema: + $ref: '#/components/schemas/errorResult' + description: Service Unavailable. + summary: Restore VPS snapshot + tags: + - publiccloud + /autoScalingGroups: + get: + description: List and filter Auto Scaling Groups + operationId: getAutoScalingGroupList + parameters: + - description: Limit the number of results returned. + example: 20 + explode: true + in: query + name: limit + required: false + schema: + type: integer + style: form + - description: Return results starting from the given offset. + example: 10 + explode: true + in: query + name: offset + required: false + schema: + type: integer + style: form + - example: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 + explode: true + in: query + name: id + required: false + schema: + format: uuid + type: string + style: form + - example: 6762182e-7ae9-4d0b-b3b7-bea5a49b3f94 + explode: true + in: query + name: instanceId + required: false + schema: + format: uuid + type: string + style: form + - description: The Auto Scaling Group's type + explode: true + in: query + name: type + required: false + schema: + enum: + - MANUAL + - SCHEDULED + - CPU_BASED + type: string + style: form + - description: The region in which the Auto Scaling Group was created + example: eu-west-3 + explode: true + in: query + name: region + required: false + schema: + $ref: '#/components/schemas/regionName' + style: form + - description: The reference used to identify identifies the Auto Scaling Group + explode: true + in: query + name: reference + required: false + schema: + type: string + style: form + - description: The Auto Scaling Group's current state + explode: true + in: query + name: state + required: false + schema: + enum: + - ACTIVE + - CREATING + - CREATED + - DESTROYED + - DESTROYING + - SCALING + - UPDATING + type: string + style: form + responses: + "200": + content: + application/json: + example: + _metadata: + totalCount: 3 + limit: 10 + offset: 0 + autoScalingGroups: + - id: fb769dab-3daa-47e4-89ed-06a4b6499176 + type: MANUAL + state: ACTIVE + desiredAmount: 2 + minimumAmount: null + maximumAmount: null + cpuThreshold: null + warmupTime: null + cooldownTime: null + region: eu-west-3 + reference: Manual Auto Scaling Group + createdAt: 2024-04-26T09:22:25+00:00 + updatedAt: 2024-04-26T09:22:25+00:00 + startsAt: null + endsAt: null + - id: aa0f2138-3a83-46fe-bdcf-1ad231f94a26 + type: SCHEDULED + state: SCALING + desiredAmount: 2 + minimumAmount: null + maximumAmount: null + cpuThreshold: null + cooldownTime: null + warmupTime: null + region: eu-west-3 + reference: Scheduled Auto Scaling Group + createdAt: 2024-05-13T15:49:52+00:00 + updatedAt: 2024-05-13T15:49:52+00:00 + startsAt: 2024-05-01T08:00:00+00:00 + endsAt: 2024-05-01T12:00:00+00:00 + - id: 49e28a6c-3f2a-442e-b3b1-981856d21677 + type: CPU_BASED + state: CREATING + desiredAmount: 1 + minimumAmount: 1 + maximumAmount: 3 + cpuThreshold: 50 + warmupTime: 300 + cooldownTime: 300 + region: eu-west-3 + reference: CPU Based Auto Scaling Group + createdAt: 2024-05-13T15:49:52+00:00 + updatedAt: 2024-05-13T15:49:52+00:00 + startsAt: null + endsAt: null + schema: + $ref: '#/components/schemas/getAutoScalingGroupListResult' + description: OK + "400": content: application/json: example: @@ -13735,8 +14251,8 @@ paths: schema: type: integer style: form - - description: Equipment Id - example: "123581321" + - description: VPS Equipment Id + example: "999999999" explode: true in: query name: id @@ -13785,16 +14301,6 @@ paths: vps: - id: "123581321" pack: Leaseweb VPS 2 - resources: - cpu: - value: 4 - unit: vCPU - memory: - value: 6 - unit: GiB - publicNetworkSpeed: - value: 10000 - unit: Mbps region: eu-central-1 datacenter: FRA-01 reference: testing @@ -13816,17 +14322,6 @@ paths: reverseLookup: "" mainIp: true networkType: PUBLIC - contract: - id: "41228459000100" - billingFrequency: 1 - term: 12 - type: MONTHLY - state: ACTIVE - endsAt: 2024-10-24T21:13:25+00:00 - createdAt: 2024-10-24T21:13:25+00:00 - sla: Basic - controlPanel: cPanel Admin 5 - inModification: false startedAt: 2024-10-24T21:13:25+00:00 schema: $ref: '#/components/schemas/getVpsListResult' @@ -13890,8 +14385,8 @@ paths: description: Get VPS details. operationId: getVps parameters: - - description: Vps ID - example: "123581321" + - description: VPS ID + example: "999999999" explode: false in: path name: vpsId @@ -13951,6 +14446,9 @@ paths: sla: Basic controlPanel: cPanel Admin 5 inModification: false + dataTraffic: + value: 30 + unit: TB startedAt: 2024-10-24T21:13:25+00:00 iso: null schema: @@ -14056,13 +14554,12 @@ components: style: simple vpsId: description: VPS ID - example: ace712e9-a166-47f1-9065-4af0f7e7fce1 + example: "999999999" explode: false in: path name: vpsId required: true schema: - format: uuid type: string style: simple credentialType: @@ -14284,8 +14781,8 @@ components: type: string style: simple vpsIdQuery: - description: Equipment Id - example: "123581321" + description: VPS Equipment Id + example: "999999999" explode: true in: query name: id @@ -14319,8 +14816,8 @@ components: $ref: '#/components/schemas/vpsPackType' style: form vpsIdPath: - description: Vps ID - example: "123581321" + description: VPS ID + example: "999999999" explode: false in: path name: vpsId @@ -15688,7 +16185,7 @@ components: minimum: 5 type: integer type: object - getConsoleAccessToInstanceResult: + getConsoleAccessResult: example: url: url properties: @@ -18218,40 +18715,6 @@ components: - SIN-01 title: datacenter type: string - vpsContract: - allOf: - - $ref: '#/components/schemas/baseContract' - - properties: - id: - example: "41228459000100" - type: string - sla: - example: Basic - type: string - controlPanel: - example: cPanel Admin 5 - nullable: true - type: string - inModification: - example: false - type: boolean - required: - - controlPanel - - id - - inModification - - sla - type: object - example: - billingFrequency: 1 - controlPanel: cPanel Admin 5 - inModification: false - createdAt: 2023-11-30T16:31:28Z - sla: Basic - term: 6 - state: ACTIVE - id: "41228459000100" - type: HOURLY - endsAt: 2023-11-30T16:31:28Z vpsBase: properties: id: @@ -18259,8 +18722,6 @@ components: type: string pack: $ref: '#/components/schemas/vpsPackType' - resources: - $ref: '#/components/schemas/baseResources' region: $ref: '#/components/schemas/regionName' datacenter: @@ -18288,10 +18749,7 @@ components: format: date-time nullable: true type: string - contract: - $ref: '#/components/schemas/vpsContract' required: - - contract - datacenter - hasPublicIpV4 - id @@ -18299,7 +18757,6 @@ components: - pack - reference - region - - resources - rootDiskSize - startedAt - state @@ -18318,6 +18775,7 @@ components: title: vps type: object example: + reference: reference image: flavour: ubuntu custom: true @@ -18325,29 +18783,12 @@ components: id: UBUNTU_22_04_64BIT family: linux rootDiskSize: 84 - contract: - billingFrequency: 1 - controlPanel: cPanel Admin 5 - inModification: false - createdAt: 2023-11-30T16:31:28Z - sla: Basic - term: 6 - state: ACTIVE - id: "41228459000100" - type: HOURLY - endsAt: 2023-11-30T16:31:28Z - resources: - memory: - unit: GiB - value: 3.75 - publicNetworkSpeed: - unit: Gbps - value: 10 - cpu: - unit: vCPU - value: 2 startedAt: 2000-01-23T04:56:07.000+00:00 datacenter: LON-01 + id: "123581321" + marketAppId: CPANEL_30 + state: RUNNING + region: eu-west-3 pack: pack ips: - prefixLength: "28" @@ -18364,45 +18805,24 @@ components: mainIp: true networkType: internal version: 3 - reference: reference - id: "123581321" - marketAppId: CPANEL_30 - state: RUNNING - region: eu-west-3 hasPublicIpV4: true getVpsListResult: example: vps: - - image: + - reference: reference + image: flavour: ubuntu custom: true name: Ubuntu 20.04 LTS (x86_64) id: UBUNTU_22_04_64BIT family: linux rootDiskSize: 84 - contract: - billingFrequency: 1 - controlPanel: cPanel Admin 5 - inModification: false - createdAt: 2023-11-30T16:31:28Z - sla: Basic - term: 6 - state: ACTIVE - id: "41228459000100" - type: HOURLY - endsAt: 2023-11-30T16:31:28Z - resources: - memory: - unit: GiB - value: 3.75 - publicNetworkSpeed: - unit: Gbps - value: 10 - cpu: - unit: vCPU - value: 2 startedAt: 2000-01-23T04:56:07.000+00:00 datacenter: LON-01 + id: "123581321" + marketAppId: CPANEL_30 + state: RUNNING + region: eu-west-3 pack: pack ips: - prefixLength: "28" @@ -18419,42 +18839,21 @@ components: mainIp: true networkType: internal version: 3 - reference: reference - id: "123581321" - marketAppId: CPANEL_30 - state: RUNNING - region: eu-west-3 hasPublicIpV4: true - - image: + - reference: reference + image: flavour: ubuntu custom: true name: Ubuntu 20.04 LTS (x86_64) id: UBUNTU_22_04_64BIT family: linux rootDiskSize: 84 - contract: - billingFrequency: 1 - controlPanel: cPanel Admin 5 - inModification: false - createdAt: 2023-11-30T16:31:28Z - sla: Basic - term: 6 - state: ACTIVE - id: "41228459000100" - type: HOURLY - endsAt: 2023-11-30T16:31:28Z - resources: - memory: - unit: GiB - value: 3.75 - publicNetworkSpeed: - unit: Gbps - value: 10 - cpu: - unit: vCPU - value: 2 startedAt: 2000-01-23T04:56:07.000+00:00 datacenter: LON-01 + id: "123581321" + marketAppId: CPANEL_30 + state: RUNNING + region: eu-west-3 pack: pack ips: - prefixLength: "28" @@ -18471,11 +18870,6 @@ components: mainIp: true networkType: internal version: 3 - reference: reference - id: "123581321" - marketAppId: CPANEL_30 - state: RUNNING - region: eu-west-3 hasPublicIpV4: true _metadata: offset: 0 @@ -18490,6 +18884,46 @@ components: $ref: '#/components/schemas/_metadata' title: vps type: object + vpsContract: + allOf: + - $ref: '#/components/schemas/baseContract' + - properties: + id: + example: "41228459000100" + type: string + sla: + example: Basic + type: string + controlPanel: + example: cPanel Admin 5 + nullable: true + type: string + inModification: + example: false + type: boolean + dataTraffic: + $ref: '#/components/schemas/dataTraffic' + required: + - controlPanel + - dataTraffic + - id + - inModification + - sla + type: object + example: + billingFrequency: 1 + controlPanel: cPanel Admin 5 + inModification: false + createdAt: 2023-11-30T16:31:28Z + sla: Basic + term: 6 + state: ACTIVE + id: "41228459000100" + dataTraffic: + unit: TB + value: 30 + type: HOURLY + endsAt: 2023-11-30T16:31:28Z vpsDetails: allOf: - $ref: '#/components/schemas/vpsBase' @@ -18500,8 +18934,14 @@ components: items: $ref: '#/components/schemas/ipDetails' type: array + resources: + $ref: '#/components/schemas/baseResources' + contract: + $ref: '#/components/schemas/vpsContract' required: + - contract - ips + - resources title: vps type: object example: @@ -18524,8 +18964,12 @@ components: term: 6 state: ACTIVE id: "41228459000100" + dataTraffic: + unit: TB + value: 30 type: HOURLY endsAt: 2023-11-30T16:31:28Z + startedAt: 2000-01-23T04:56:07.000+00:00 resources: memory: unit: GiB @@ -18536,7 +18980,6 @@ components: cpu: unit: vCPU value: 2 - startedAt: 2000-01-23T04:56:07.000+00:00 datacenter: LON-01 pack: pack ips: @@ -19245,6 +19688,23 @@ components: - uri title: healthCheck type: object + dataTraffic: + description: Data traffic commitment + example: + unit: TB + value: 30 + properties: + value: + example: 30 + type: number + unit: + enum: + - TB + - GB + example: TB + type: string + title: dataTraffic + type: object securitySchemes: BearerAuth: scheme: bearer diff --git a/publiccloud/api_publiccloud.go b/publiccloud/api_publiccloud.go index 834dba2..a5839fc 100644 --- a/publiccloud/api_publiccloud.go +++ b/publiccloud/api_publiccloud.go @@ -112,6 +112,24 @@ Available ISOs can be obtained using `/v1/isos`. // @return ImageDetails CreateImageExecute(r ApiCreateImageRequest) (*ImageDetails, *http.Response, error) + /* + CreateInstanceSnapshot Create instance snapshot + + The instance must be running before the execution. + +The time taken to create the snapshot depends on several factors, including memory size and usage. + +Allowed only one snapshot per instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId Instance's ID + @return ApiCreateInstanceSnapshotRequest + */ + CreateInstanceSnapshot(ctx context.Context, instanceId string) ApiCreateInstanceSnapshotRequest + + // CreateInstanceSnapshotExecute executes the request + CreateInstanceSnapshotExecute(r ApiCreateInstanceSnapshotRequest) (*http.Response, error) + /* CreateLoadBalancerListener Create listener @@ -127,24 +145,6 @@ Available ISOs can be obtained using `/v1/isos`. // @return LoadBalancerListener CreateLoadBalancerListenerExecute(r ApiCreateLoadBalancerListenerRequest) (*LoadBalancerListener, *http.Response, error) - /* - CreateSnapshot Create instance snapshot - - The instance must be running before the execution. - -The time taken to create the snapshot depends on several factors, including memory size and usage. - -Allowed only one snapshot per instance. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @return ApiCreateSnapshotRequest - */ - CreateSnapshot(ctx context.Context, instanceId string) ApiCreateSnapshotRequest - - // CreateSnapshotExecute executes the request - CreateSnapshotExecute(r ApiCreateSnapshotRequest) (*http.Response, error) - /* CreateTargetGroup Create Target Group @@ -159,6 +159,24 @@ Allowed only one snapshot per instance. // @return TargetGroup CreateTargetGroupExecute(r ApiCreateTargetGroupRequest) (*TargetGroup, *http.Response, error) + /* + CreateVPSSnapshot Create VPS snapshot + + The VPS must be running before the execution. + +The time taken to create the snapshot depends on several factors, including memory size and usage. + +Allowed only one snapshot per VPS. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param vpsId VPS ID + @return ApiCreateVPSSnapshotRequest + */ + CreateVPSSnapshot(ctx context.Context, vpsId string) ApiCreateVPSSnapshotRequest + + // CreateVPSSnapshotExecute executes the request + CreateVPSSnapshotExecute(r ApiCreateVPSSnapshotRequest) (*http.Response, error) + /* DeleteAutoScalingGroup Delete Auto Scaling Group @@ -199,6 +217,19 @@ Allowed only one snapshot per instance. // DeleteInstanceCredentialsExecute executes the request DeleteInstanceCredentialsExecute(r ApiDeleteInstanceCredentialsRequest) (*http.Response, error) + /* + DeleteInstanceSnapshot Delete instance snapshot + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId Instance's ID + @param snapshotId + @return ApiDeleteInstanceSnapshotRequest + */ + DeleteInstanceSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiDeleteInstanceSnapshotRequest + + // DeleteInstanceSnapshotExecute executes the request + DeleteInstanceSnapshotExecute(r ApiDeleteInstanceSnapshotRequest) (*http.Response, error) + /* DeleteLoadBalancerListener Delete load balancer listener @@ -214,19 +245,6 @@ Allowed only one snapshot per instance. // DeleteLoadBalancerListenerExecute executes the request DeleteLoadBalancerListenerExecute(r ApiDeleteLoadBalancerListenerRequest) (*http.Response, error) - /* - DeleteSnapshot Delete instance snapshot - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @param snapshotId - @return ApiDeleteSnapshotRequest - */ - DeleteSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiDeleteSnapshotRequest - - // DeleteSnapshotExecute executes the request - DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) (*http.Response, error) - /* DeleteTargetGroup Delete Target Group @@ -269,6 +287,19 @@ Allowed only one snapshot per instance. // DeleteVPSCredentialsExecute executes the request DeleteVPSCredentialsExecute(r ApiDeleteVPSCredentialsRequest) (*http.Response, error) + /* + DeleteVPSSnapshot Delete VPS snapshot + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param vpsId VPS ID + @param snapshotId + @return ApiDeleteVPSSnapshotRequest + */ + DeleteVPSSnapshot(ctx context.Context, vpsId string, snapshotId string) ApiDeleteVPSSnapshotRequest + + // DeleteVPSSnapshotExecute executes the request + DeleteVPSSnapshotExecute(r ApiDeleteVPSSnapshotRequest) (*http.Response, error) + /* DeregisterAutoScalingGroupTargetGroup Deregister Target Group @@ -396,21 +427,6 @@ Allowed only one snapshot per instance. // @return GetConnectionsPerSecondMetricsResult GetConnectionsPerSecondMetricsExecute(r ApiGetConnectionsPerSecondMetricsRequest) (*GetConnectionsPerSecondMetricsResult, *http.Response, error) - /* - GetConsoleAccessToInstance Get console access - - Get console access to the instance - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @return ApiGetConsoleAccessToInstanceRequest - */ - GetConsoleAccessToInstance(ctx context.Context, instanceId string) ApiGetConsoleAccessToInstanceRequest - - // GetConsoleAccessToInstanceExecute executes the request - // @return GetConsoleAccessToInstanceResult - GetConsoleAccessToInstanceExecute(r ApiGetConsoleAccessToInstanceRequest) (*GetConsoleAccessToInstanceResult, *http.Response, error) - /* GetCpuMetrics Get instance CPU metrics @@ -490,6 +506,21 @@ Allowed only one snapshot per instance. // @return InstanceDetails GetInstanceExecute(r ApiGetInstanceRequest) (*InstanceDetails, *http.Response, error) + /* + GetInstanceConsoleAccess Get console access + + Get console access to the instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId Instance's ID + @return ApiGetInstanceConsoleAccessRequest + */ + GetInstanceConsoleAccess(ctx context.Context, instanceId string) ApiGetInstanceConsoleAccessRequest + + // GetInstanceConsoleAccessExecute executes the request + // @return GetConsoleAccessResult + GetInstanceConsoleAccessExecute(r ApiGetInstanceConsoleAccessRequest) (*GetConsoleAccessResult, *http.Response, error) + /* GetInstanceCredential Get Instance credentials by type and username. @@ -588,6 +619,35 @@ Allowed only one snapshot per instance. // @return GetInstanceListResult GetInstanceListExecute(r ApiGetInstanceListRequest) (*GetInstanceListResult, *http.Response, error) + /* + GetInstanceSnapshot Get snapshot detail + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId Instance's ID + @param snapshotId + @return ApiGetInstanceSnapshotRequest + */ + GetInstanceSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiGetInstanceSnapshotRequest + + // GetInstanceSnapshotExecute executes the request + // @return Snapshot + GetInstanceSnapshotExecute(r ApiGetInstanceSnapshotRequest) (*Snapshot, *http.Response, error) + + /* + GetInstanceSnapshotList List snapshots + + List instance snapshots + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId Instance's ID + @return ApiGetInstanceSnapshotListRequest + */ + GetInstanceSnapshotList(ctx context.Context, instanceId string) ApiGetInstanceSnapshotListRequest + + // GetInstanceSnapshotListExecute executes the request + // @return GetSnapshotListResult + GetInstanceSnapshotListExecute(r ApiGetInstanceSnapshotListRequest) (*GetSnapshotListResult, *http.Response, error) + /* GetInstanceTypeList List instance types @@ -822,35 +882,6 @@ Allowed only one snapshot per instance. // @return GetResponseCodesPerSecondMetricsResult GetResponseCodesPerSecondMetricsExecute(r ApiGetResponseCodesPerSecondMetricsRequest) (*GetResponseCodesPerSecondMetricsResult, *http.Response, error) - /* - GetSnapshot Get snapshot detail - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @param snapshotId - @return ApiGetSnapshotRequest - */ - GetSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiGetSnapshotRequest - - // GetSnapshotExecute executes the request - // @return Snapshot - GetSnapshotExecute(r ApiGetSnapshotRequest) (*Snapshot, *http.Response, error) - - /* - GetSnapshotList List snapshots - - List instance snapshots - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @return ApiGetSnapshotListRequest - */ - GetSnapshotList(ctx context.Context, instanceId string) ApiGetSnapshotListRequest - - // GetSnapshotListExecute executes the request - // @return GetSnapshotListResult - GetSnapshotListExecute(r ApiGetSnapshotListRequest) (*GetSnapshotListResult, *http.Response, error) - /* GetTargetGroup Get Target Group details @@ -910,6 +941,21 @@ Allowed only one snapshot per instance. // @return InstanceTypes GetUpdateInstanceTypeListExecute(r ApiGetUpdateInstanceTypeListRequest) (*InstanceTypes, *http.Response, error) + /* + GetVPSConsoleAccess Get console access + + Get console access to the VPS + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param vpsId VPS ID + @return ApiGetVPSConsoleAccessRequest + */ + GetVPSConsoleAccess(ctx context.Context, vpsId string) ApiGetVPSConsoleAccessRequest + + // GetVPSConsoleAccessExecute executes the request + // @return GetConsoleAccessResult + GetVPSConsoleAccessExecute(r ApiGetVPSConsoleAccessRequest) (*GetConsoleAccessResult, *http.Response, error) + /* GetVPSCredential Get VPS credential by type and username. @@ -994,13 +1040,42 @@ Allowed only one snapshot per instance. // @return GetIPListResult GetVPSIPListExecute(r ApiGetVPSIPListRequest) (*GetIPListResult, *http.Response, error) + /* + GetVPSSnapshot Get snapshot detail + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param vpsId VPS ID + @param snapshotId + @return ApiGetVPSSnapshotRequest + */ + GetVPSSnapshot(ctx context.Context, vpsId string, snapshotId string) ApiGetVPSSnapshotRequest + + // GetVPSSnapshotExecute executes the request + // @return Snapshot + GetVPSSnapshotExecute(r ApiGetVPSSnapshotRequest) (*Snapshot, *http.Response, error) + + /* + GetVPSSnapshotList List snapshots + + List VPS snapshots + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param vpsId VPS ID + @return ApiGetVPSSnapshotListRequest + */ + GetVPSSnapshotList(ctx context.Context, vpsId string) ApiGetVPSSnapshotListRequest + + // GetVPSSnapshotListExecute executes the request + // @return GetSnapshotListResult + GetVPSSnapshotListExecute(r ApiGetVPSSnapshotListRequest) (*GetSnapshotListResult, *http.Response, error) + /* GetVps Get VPS details Get VPS details. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param vpsId Vps ID + @param vpsId VPS ID @return ApiGetVpsRequest */ GetVps(ctx context.Context, vpsId string) ApiGetVpsRequest @@ -1323,17 +1398,30 @@ You can obtain the new credential using the credentials endpoints ResetVPSPasswordExecute(r ApiResetVPSPasswordRequest) (*http.Response, error) /* - RestoreSnapshot Restore instance snapshot + RestoreInstanceSnapshot Restore instance snapshot @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId Instance's ID @param snapshotId - @return ApiRestoreSnapshotRequest + @return ApiRestoreInstanceSnapshotRequest */ - RestoreSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiRestoreSnapshotRequest + RestoreInstanceSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiRestoreInstanceSnapshotRequest - // RestoreSnapshotExecute executes the request - RestoreSnapshotExecute(r ApiRestoreSnapshotRequest) (*http.Response, error) + // RestoreInstanceSnapshotExecute executes the request + RestoreInstanceSnapshotExecute(r ApiRestoreInstanceSnapshotRequest) (*http.Response, error) + + /* + RestoreVPSSnapshot Restore VPS snapshot + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param vpsId VPS ID + @param snapshotId + @return ApiRestoreVPSSnapshotRequest + */ + RestoreVPSSnapshot(ctx context.Context, vpsId string, snapshotId string) ApiRestoreVPSSnapshotRequest + + // RestoreVPSSnapshotExecute executes the request + RestoreVPSSnapshotExecute(r ApiRestoreVPSSnapshotRequest) (*http.Response, error) /* StartInstance Start a specific resource Instance @@ -1364,7 +1452,7 @@ You can obtain the new credential using the credentials endpoints StartLoadBalancerExecute(r ApiStartLoadBalancerRequest) (*http.Response, error) /* - StartVPS Start a specific resource VPS + StartVPS Start a specific VPS The VPS must be stopped before the execution @@ -2714,66 +2802,59 @@ func (a *PubliccloudAPIService) CreateImageExecute(r ApiCreateImageRequest) (*Im return localVarReturnValue, localVarHTTPResponse, nil } -type ApiCreateLoadBalancerListenerRequest struct { +type ApiCreateInstanceSnapshotRequest struct { ctx context.Context ApiService PubliccloudAPI - loadBalancerId string - loadBalancerListenerCreateOpts *LoadBalancerListenerCreateOpts -} - -func (r ApiCreateLoadBalancerListenerRequest) LoadBalancerListenerCreateOpts(loadBalancerListenerCreateOpts LoadBalancerListenerCreateOpts) ApiCreateLoadBalancerListenerRequest { - r.loadBalancerListenerCreateOpts = &loadBalancerListenerCreateOpts - return r + instanceId string } -func (r ApiCreateLoadBalancerListenerRequest) Execute() (*LoadBalancerListener, *http.Response, error) { - return r.ApiService.CreateLoadBalancerListenerExecute(r) +func (r ApiCreateInstanceSnapshotRequest) Execute() (*http.Response, error) { + return r.ApiService.CreateInstanceSnapshotExecute(r) } /* -CreateLoadBalancerListener Create listener +CreateInstanceSnapshot Create instance snapshot -Create listener +The instance must be running before the execution. + +The time taken to create the snapshot depends on several factors, including memory size and usage. + +Allowed only one snapshot per instance. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param loadBalancerId Load balancer ID - @return ApiCreateLoadBalancerListenerRequest + @param instanceId Instance's ID + @return ApiCreateInstanceSnapshotRequest */ -func (a *PubliccloudAPIService) CreateLoadBalancerListener(ctx context.Context, loadBalancerId string) ApiCreateLoadBalancerListenerRequest { - return ApiCreateLoadBalancerListenerRequest{ +func (a *PubliccloudAPIService) CreateInstanceSnapshot(ctx context.Context, instanceId string) ApiCreateInstanceSnapshotRequest { + return ApiCreateInstanceSnapshotRequest{ ApiService: a, ctx: ctx, - loadBalancerId: loadBalancerId, + instanceId: instanceId, } } // Execute executes the request -// @return LoadBalancerListener -func (a *PubliccloudAPIService) CreateLoadBalancerListenerExecute(r ApiCreateLoadBalancerListenerRequest) (*LoadBalancerListener, *http.Response, error) { +func (a *PubliccloudAPIService) CreateInstanceSnapshotExecute(r ApiCreateInstanceSnapshotRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *LoadBalancerListener ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.CreateLoadBalancerListener") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.CreateInstanceSnapshot") if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/listeners" - localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) + localVarPath := localBasePath + "/instances/{instanceId}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.loadBalancerListenerCreateOpts == nil { - return localVarReturnValue, nil, reportError("loadBalancerListenerCreateOpts is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2789,8 +2870,6 @@ func (a *PubliccloudAPIService) CreateLoadBalancerListenerExecute(r ApiCreateLoa if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.loadBalancerListenerCreateOpts if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -2807,19 +2886,19 @@ func (a *PubliccloudAPIService) CreateLoadBalancerListenerExecute(r ApiCreateLoa } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -2832,123 +2911,132 @@ func (a *PubliccloudAPIService) CreateLoadBalancerListenerExecute(r ApiCreateLoa err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 503 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiCreateSnapshotRequest struct { +type ApiCreateLoadBalancerListenerRequest struct { ctx context.Context ApiService PubliccloudAPI - instanceId string + loadBalancerId string + loadBalancerListenerCreateOpts *LoadBalancerListenerCreateOpts +} + +func (r ApiCreateLoadBalancerListenerRequest) LoadBalancerListenerCreateOpts(loadBalancerListenerCreateOpts LoadBalancerListenerCreateOpts) ApiCreateLoadBalancerListenerRequest { + r.loadBalancerListenerCreateOpts = &loadBalancerListenerCreateOpts + return r } -func (r ApiCreateSnapshotRequest) Execute() (*http.Response, error) { - return r.ApiService.CreateSnapshotExecute(r) +func (r ApiCreateLoadBalancerListenerRequest) Execute() (*LoadBalancerListener, *http.Response, error) { + return r.ApiService.CreateLoadBalancerListenerExecute(r) } /* -CreateSnapshot Create instance snapshot +CreateLoadBalancerListener Create listener -The instance must be running before the execution. - -The time taken to create the snapshot depends on several factors, including memory size and usage. - -Allowed only one snapshot per instance. +Create listener @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @return ApiCreateSnapshotRequest + @param loadBalancerId Load balancer ID + @return ApiCreateLoadBalancerListenerRequest */ -func (a *PubliccloudAPIService) CreateSnapshot(ctx context.Context, instanceId string) ApiCreateSnapshotRequest { - return ApiCreateSnapshotRequest{ +func (a *PubliccloudAPIService) CreateLoadBalancerListener(ctx context.Context, loadBalancerId string) ApiCreateLoadBalancerListenerRequest { + return ApiCreateLoadBalancerListenerRequest{ ApiService: a, ctx: ctx, - instanceId: instanceId, + loadBalancerId: loadBalancerId, } } // Execute executes the request -func (a *PubliccloudAPIService) CreateSnapshotExecute(r ApiCreateSnapshotRequest) (*http.Response, error) { +// @return LoadBalancerListener +func (a *PubliccloudAPIService) CreateLoadBalancerListenerExecute(r ApiCreateLoadBalancerListenerRequest) (*LoadBalancerListener, *http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile + localVarReturnValue *LoadBalancerListener ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.CreateSnapshot") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.CreateLoadBalancerListener") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/instances/{instanceId}/snapshots" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/listeners" + localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.loadBalancerListenerCreateOpts == nil { + return localVarReturnValue, nil, reportError("loadBalancerListenerCreateOpts is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -2964,6 +3052,8 @@ func (a *PubliccloudAPIService) CreateSnapshotExecute(r ApiCreateSnapshotRequest if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.loadBalancerListenerCreateOpts if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -2980,19 +3070,19 @@ func (a *PubliccloudAPIService) CreateSnapshotExecute(r ApiCreateSnapshotRequest } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -3005,70 +3095,68 @@ func (a *PubliccloudAPIService) CreateSnapshotExecute(r ApiCreateSnapshotRequest err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResult - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 503 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } type ApiCreateTargetGroupRequest struct { @@ -3249,48 +3337,52 @@ func (a *PubliccloudAPIService) CreateTargetGroupExecute(r ApiCreateTargetGroupR return localVarReturnValue, localVarHTTPResponse, nil } -type ApiDeleteAutoScalingGroupRequest struct { +type ApiCreateVPSSnapshotRequest struct { ctx context.Context ApiService PubliccloudAPI - autoScalingGroupId string + vpsId string } -func (r ApiDeleteAutoScalingGroupRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteAutoScalingGroupExecute(r) +func (r ApiCreateVPSSnapshotRequest) Execute() (*http.Response, error) { + return r.ApiService.CreateVPSSnapshotExecute(r) } /* -DeleteAutoScalingGroup Delete Auto Scaling Group +CreateVPSSnapshot Create VPS snapshot -Delete an Auto Scaling Group. +The VPS must be running before the execution. + +The time taken to create the snapshot depends on several factors, including memory size and usage. + +Allowed only one snapshot per VPS. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param autoScalingGroupId Auto Scaling Group ID - @return ApiDeleteAutoScalingGroupRequest + @param vpsId VPS ID + @return ApiCreateVPSSnapshotRequest */ -func (a *PubliccloudAPIService) DeleteAutoScalingGroup(ctx context.Context, autoScalingGroupId string) ApiDeleteAutoScalingGroupRequest { - return ApiDeleteAutoScalingGroupRequest{ +func (a *PubliccloudAPIService) CreateVPSSnapshot(ctx context.Context, vpsId string) ApiCreateVPSSnapshotRequest { + return ApiCreateVPSSnapshotRequest{ ApiService: a, ctx: ctx, - autoScalingGroupId: autoScalingGroupId, + vpsId: vpsId, } } // Execute executes the request -func (a *PubliccloudAPIService) DeleteAutoScalingGroupExecute(r ApiDeleteAutoScalingGroupRequest) (*http.Response, error) { +func (a *PubliccloudAPIService) CreateVPSSnapshotExecute(r ApiCreateVPSSnapshotRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodDelete + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteAutoScalingGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.CreateVPSSnapshot") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/autoScalingGroups/{autoScalingGroupId}" - localVarPath = strings.Replace(localVarPath, "{"+"autoScalingGroupId"+"}", url.PathEscape(parameterValueToString(r.autoScalingGroupId, "autoScalingGroupId")), -1) + localVarPath := localBasePath + "/vps/{vpsId}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3420,54 +3512,48 @@ func (a *PubliccloudAPIService) DeleteAutoScalingGroupExecute(r ApiDeleteAutoSca return localVarHTTPResponse, nil } -type ApiDeleteInstanceCredentialRequest struct { +type ApiDeleteAutoScalingGroupRequest struct { ctx context.Context ApiService PubliccloudAPI - instanceId string - type_ CredentialType - username string + autoScalingGroupId string } -func (r ApiDeleteInstanceCredentialRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteInstanceCredentialExecute(r) +func (r ApiDeleteAutoScalingGroupRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteAutoScalingGroupExecute(r) } /* -DeleteInstanceCredential Delete Instance credential for a given type and username +DeleteAutoScalingGroup Delete Auto Scaling Group + +Delete an Auto Scaling Group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @param type_ Type of credential - @param username Username - @return ApiDeleteInstanceCredentialRequest + @param autoScalingGroupId Auto Scaling Group ID + @return ApiDeleteAutoScalingGroupRequest */ -func (a *PubliccloudAPIService) DeleteInstanceCredential(ctx context.Context, instanceId string, type_ CredentialType, username string) ApiDeleteInstanceCredentialRequest { - return ApiDeleteInstanceCredentialRequest{ +func (a *PubliccloudAPIService) DeleteAutoScalingGroup(ctx context.Context, autoScalingGroupId string) ApiDeleteAutoScalingGroupRequest { + return ApiDeleteAutoScalingGroupRequest{ ApiService: a, ctx: ctx, - instanceId: instanceId, - type_: type_, - username: username, + autoScalingGroupId: autoScalingGroupId, } } // Execute executes the request -func (a *PubliccloudAPIService) DeleteInstanceCredentialExecute(r ApiDeleteInstanceCredentialRequest) (*http.Response, error) { +func (a *PubliccloudAPIService) DeleteAutoScalingGroupExecute(r ApiDeleteAutoScalingGroupRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteInstanceCredential") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteAutoScalingGroup") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/instances/{instanceId}/credentials/{type}/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", url.PathEscape(parameterValueToString(r.type_, "type_")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) + localVarPath := localBasePath + "/autoScalingGroups/{autoScalingGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"autoScalingGroupId"+"}", url.PathEscape(parameterValueToString(r.autoScalingGroupId, "autoScalingGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3526,6 +3612,17 @@ func (a *PubliccloudAPIService) DeleteInstanceCredentialExecute(r ApiDeleteInsta body: localVarBody, error: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3586,46 +3683,54 @@ func (a *PubliccloudAPIService) DeleteInstanceCredentialExecute(r ApiDeleteInsta return localVarHTTPResponse, nil } -type ApiDeleteInstanceCredentialsRequest struct { +type ApiDeleteInstanceCredentialRequest struct { ctx context.Context ApiService PubliccloudAPI instanceId string + type_ CredentialType + username string } -func (r ApiDeleteInstanceCredentialsRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteInstanceCredentialsExecute(r) +func (r ApiDeleteInstanceCredentialRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteInstanceCredentialExecute(r) } /* -DeleteInstanceCredentials Delete all credentials associated with a specific Instance +DeleteInstanceCredential Delete Instance credential for a given type and username @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId Instance's ID - @return ApiDeleteInstanceCredentialsRequest + @param type_ Type of credential + @param username Username + @return ApiDeleteInstanceCredentialRequest */ -func (a *PubliccloudAPIService) DeleteInstanceCredentials(ctx context.Context, instanceId string) ApiDeleteInstanceCredentialsRequest { - return ApiDeleteInstanceCredentialsRequest{ +func (a *PubliccloudAPIService) DeleteInstanceCredential(ctx context.Context, instanceId string, type_ CredentialType, username string) ApiDeleteInstanceCredentialRequest { + return ApiDeleteInstanceCredentialRequest{ ApiService: a, ctx: ctx, instanceId: instanceId, + type_: type_, + username: username, } } // Execute executes the request -func (a *PubliccloudAPIService) DeleteInstanceCredentialsExecute(r ApiDeleteInstanceCredentialsRequest) (*http.Response, error) { +func (a *PubliccloudAPIService) DeleteInstanceCredentialExecute(r ApiDeleteInstanceCredentialRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteInstanceCredentials") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteInstanceCredential") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/instances/{instanceId}/credentials" + localVarPath := localBasePath + "/instances/{instanceId}/credentials/{type}/{username}" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", url.PathEscape(parameterValueToString(r.type_, "type_")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3744,52 +3849,46 @@ func (a *PubliccloudAPIService) DeleteInstanceCredentialsExecute(r ApiDeleteInst return localVarHTTPResponse, nil } -type ApiDeleteLoadBalancerListenerRequest struct { +type ApiDeleteInstanceCredentialsRequest struct { ctx context.Context ApiService PubliccloudAPI - loadBalancerId string - listenerId string + instanceId string } -func (r ApiDeleteLoadBalancerListenerRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteLoadBalancerListenerExecute(r) +func (r ApiDeleteInstanceCredentialsRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteInstanceCredentialsExecute(r) } /* -DeleteLoadBalancerListener Delete load balancer listener - -Delete a listener +DeleteInstanceCredentials Delete all credentials associated with a specific Instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param loadBalancerId Load balancer ID - @param listenerId Listener ID - @return ApiDeleteLoadBalancerListenerRequest + @param instanceId Instance's ID + @return ApiDeleteInstanceCredentialsRequest */ -func (a *PubliccloudAPIService) DeleteLoadBalancerListener(ctx context.Context, loadBalancerId string, listenerId string) ApiDeleteLoadBalancerListenerRequest { - return ApiDeleteLoadBalancerListenerRequest{ +func (a *PubliccloudAPIService) DeleteInstanceCredentials(ctx context.Context, instanceId string) ApiDeleteInstanceCredentialsRequest { + return ApiDeleteInstanceCredentialsRequest{ ApiService: a, ctx: ctx, - loadBalancerId: loadBalancerId, - listenerId: listenerId, + instanceId: instanceId, } } // Execute executes the request -func (a *PubliccloudAPIService) DeleteLoadBalancerListenerExecute(r ApiDeleteLoadBalancerListenerRequest) (*http.Response, error) { +func (a *PubliccloudAPIService) DeleteInstanceCredentialsExecute(r ApiDeleteInstanceCredentialsRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteLoadBalancerListener") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteInstanceCredentials") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/listeners/{listenerId}" - localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"listenerId"+"}", url.PathEscape(parameterValueToString(r.listenerId, "listenerId")), -1) + localVarPath := localBasePath + "/instances/{instanceId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -3848,17 +3947,6 @@ func (a *PubliccloudAPIService) DeleteLoadBalancerListenerExecute(r ApiDeleteLoa body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResult - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -3919,27 +4007,27 @@ func (a *PubliccloudAPIService) DeleteLoadBalancerListenerExecute(r ApiDeleteLoa return localVarHTTPResponse, nil } -type ApiDeleteSnapshotRequest struct { +type ApiDeleteInstanceSnapshotRequest struct { ctx context.Context ApiService PubliccloudAPI instanceId string snapshotId string } -func (r ApiDeleteSnapshotRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteSnapshotExecute(r) +func (r ApiDeleteInstanceSnapshotRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteInstanceSnapshotExecute(r) } /* -DeleteSnapshot Delete instance snapshot +DeleteInstanceSnapshot Delete instance snapshot @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId Instance's ID @param snapshotId - @return ApiDeleteSnapshotRequest + @return ApiDeleteInstanceSnapshotRequest */ -func (a *PubliccloudAPIService) DeleteSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiDeleteSnapshotRequest { - return ApiDeleteSnapshotRequest{ +func (a *PubliccloudAPIService) DeleteInstanceSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiDeleteInstanceSnapshotRequest { + return ApiDeleteInstanceSnapshotRequest{ ApiService: a, ctx: ctx, instanceId: instanceId, @@ -3948,14 +4036,14 @@ func (a *PubliccloudAPIService) DeleteSnapshot(ctx context.Context, instanceId s } // Execute executes the request -func (a *PubliccloudAPIService) DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) (*http.Response, error) { +func (a *PubliccloudAPIService) DeleteInstanceSnapshotExecute(r ApiDeleteInstanceSnapshotRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteSnapshot") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteInstanceSnapshot") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } @@ -4092,48 +4180,52 @@ func (a *PubliccloudAPIService) DeleteSnapshotExecute(r ApiDeleteSnapshotRequest return localVarHTTPResponse, nil } -type ApiDeleteTargetGroupRequest struct { +type ApiDeleteLoadBalancerListenerRequest struct { ctx context.Context ApiService PubliccloudAPI - targetGroupId string + loadBalancerId string + listenerId string } -func (r ApiDeleteTargetGroupRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteTargetGroupExecute(r) +func (r ApiDeleteLoadBalancerListenerRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteLoadBalancerListenerExecute(r) } /* -DeleteTargetGroup Delete Target Group +DeleteLoadBalancerListener Delete load balancer listener -Delete a Target Group. +Delete a listener @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param targetGroupId Target Group ID - @return ApiDeleteTargetGroupRequest + @param loadBalancerId Load balancer ID + @param listenerId Listener ID + @return ApiDeleteLoadBalancerListenerRequest */ -func (a *PubliccloudAPIService) DeleteTargetGroup(ctx context.Context, targetGroupId string) ApiDeleteTargetGroupRequest { - return ApiDeleteTargetGroupRequest{ +func (a *PubliccloudAPIService) DeleteLoadBalancerListener(ctx context.Context, loadBalancerId string, listenerId string) ApiDeleteLoadBalancerListenerRequest { + return ApiDeleteLoadBalancerListenerRequest{ ApiService: a, ctx: ctx, - targetGroupId: targetGroupId, + loadBalancerId: loadBalancerId, + listenerId: listenerId, } } // Execute executes the request -func (a *PubliccloudAPIService) DeleteTargetGroupExecute(r ApiDeleteTargetGroupRequest) (*http.Response, error) { +func (a *PubliccloudAPIService) DeleteLoadBalancerListenerExecute(r ApiDeleteLoadBalancerListenerRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteTargetGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteLoadBalancerListener") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/targetGroups/{targetGroupId}" - localVarPath = strings.Replace(localVarPath, "{"+"targetGroupId"+"}", url.PathEscape(parameterValueToString(r.targetGroupId, "targetGroupId")), -1) + localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/listeners/{listenerId}" + localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"listenerId"+"}", url.PathEscape(parameterValueToString(r.listenerId, "listenerId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4263,54 +4355,48 @@ func (a *PubliccloudAPIService) DeleteTargetGroupExecute(r ApiDeleteTargetGroupR return localVarHTTPResponse, nil } -type ApiDeleteVPSCredentialRequest struct { +type ApiDeleteTargetGroupRequest struct { ctx context.Context ApiService PubliccloudAPI - vpsId string - type_ CredentialType - username string + targetGroupId string } -func (r ApiDeleteVPSCredentialRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteVPSCredentialExecute(r) +func (r ApiDeleteTargetGroupRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteTargetGroupExecute(r) } /* -DeleteVPSCredential Delete VPS credential +DeleteTargetGroup Delete Target Group + +Delete a Target Group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param vpsId VPS ID - @param type_ Type of credential - @param username Username - @return ApiDeleteVPSCredentialRequest + @param targetGroupId Target Group ID + @return ApiDeleteTargetGroupRequest */ -func (a *PubliccloudAPIService) DeleteVPSCredential(ctx context.Context, vpsId string, type_ CredentialType, username string) ApiDeleteVPSCredentialRequest { - return ApiDeleteVPSCredentialRequest{ +func (a *PubliccloudAPIService) DeleteTargetGroup(ctx context.Context, targetGroupId string) ApiDeleteTargetGroupRequest { + return ApiDeleteTargetGroupRequest{ ApiService: a, ctx: ctx, - vpsId: vpsId, - type_: type_, - username: username, + targetGroupId: targetGroupId, } } // Execute executes the request -func (a *PubliccloudAPIService) DeleteVPSCredentialExecute(r ApiDeleteVPSCredentialRequest) (*http.Response, error) { +func (a *PubliccloudAPIService) DeleteTargetGroupExecute(r ApiDeleteTargetGroupRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteVPSCredential") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteTargetGroup") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/vps/{vpsId}/credentials/{type}/{username}" - localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", url.PathEscape(parameterValueToString(r.type_, "type_")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) + localVarPath := localBasePath + "/targetGroups/{targetGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"targetGroupId"+"}", url.PathEscape(parameterValueToString(r.targetGroupId, "targetGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4369,6 +4455,17 @@ func (a *PubliccloudAPIService) DeleteVPSCredentialExecute(r ApiDeleteVPSCredent body: localVarBody, error: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4429,48 +4526,54 @@ func (a *PubliccloudAPIService) DeleteVPSCredentialExecute(r ApiDeleteVPSCredent return localVarHTTPResponse, nil } -type ApiDeleteVPSCredentialsRequest struct { +type ApiDeleteVPSCredentialRequest struct { ctx context.Context ApiService PubliccloudAPI vpsId string + type_ CredentialType + username string } -func (r ApiDeleteVPSCredentialsRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteVPSCredentialsExecute(r) +func (r ApiDeleteVPSCredentialRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteVPSCredentialExecute(r) } /* -DeleteVPSCredentials Delete all credentials associated with a specific VPS - -Delete all credentials stored for a given VPS. +DeleteVPSCredential Delete VPS credential @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vpsId VPS ID - @return ApiDeleteVPSCredentialsRequest + @param type_ Type of credential + @param username Username + @return ApiDeleteVPSCredentialRequest */ -func (a *PubliccloudAPIService) DeleteVPSCredentials(ctx context.Context, vpsId string) ApiDeleteVPSCredentialsRequest { - return ApiDeleteVPSCredentialsRequest{ +func (a *PubliccloudAPIService) DeleteVPSCredential(ctx context.Context, vpsId string, type_ CredentialType, username string) ApiDeleteVPSCredentialRequest { + return ApiDeleteVPSCredentialRequest{ ApiService: a, ctx: ctx, vpsId: vpsId, + type_: type_, + username: username, } } // Execute executes the request -func (a *PubliccloudAPIService) DeleteVPSCredentialsExecute(r ApiDeleteVPSCredentialsRequest) (*http.Response, error) { +func (a *PubliccloudAPIService) DeleteVPSCredentialExecute(r ApiDeleteVPSCredentialRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteVPSCredentials") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteVPSCredential") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/vps/{vpsId}/credentials" + localVarPath := localBasePath + "/vps/{vpsId}/credentials/{type}/{username}" localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", url.PathEscape(parameterValueToString(r.type_, "type_")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -4589,66 +4692,55 @@ func (a *PubliccloudAPIService) DeleteVPSCredentialsExecute(r ApiDeleteVPSCreden return localVarHTTPResponse, nil } -type ApiDeregisterAutoScalingGroupTargetGroupRequest struct { +type ApiDeleteVPSCredentialsRequest struct { ctx context.Context ApiService PubliccloudAPI - autoScalingGroupId string - targetGroupIdOpts *TargetGroupIdOpts -} - -func (r ApiDeregisterAutoScalingGroupTargetGroupRequest) TargetGroupIdOpts(targetGroupIdOpts TargetGroupIdOpts) ApiDeregisterAutoScalingGroupTargetGroupRequest { - r.targetGroupIdOpts = &targetGroupIdOpts - return r + vpsId string } -func (r ApiDeregisterAutoScalingGroupTargetGroupRequest) Execute() (*AutoScalingGroupDetails, *http.Response, error) { - return r.ApiService.DeregisterAutoScalingGroupTargetGroupExecute(r) +func (r ApiDeleteVPSCredentialsRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteVPSCredentialsExecute(r) } /* -DeregisterAutoScalingGroupTargetGroup Deregister Target Group +DeleteVPSCredentials Delete all credentials associated with a specific VPS -Disassociate a target group from an Auto Scaling Group +Delete all credentials stored for a given VPS. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param autoScalingGroupId Auto Scaling Group ID - @return ApiDeregisterAutoScalingGroupTargetGroupRequest + @param vpsId VPS ID + @return ApiDeleteVPSCredentialsRequest */ -func (a *PubliccloudAPIService) DeregisterAutoScalingGroupTargetGroup(ctx context.Context, autoScalingGroupId string) ApiDeregisterAutoScalingGroupTargetGroupRequest { - return ApiDeregisterAutoScalingGroupTargetGroupRequest{ +func (a *PubliccloudAPIService) DeleteVPSCredentials(ctx context.Context, vpsId string) ApiDeleteVPSCredentialsRequest { + return ApiDeleteVPSCredentialsRequest{ ApiService: a, ctx: ctx, - autoScalingGroupId: autoScalingGroupId, + vpsId: vpsId, } } // Execute executes the request -// @return AutoScalingGroupDetails -func (a *PubliccloudAPIService) DeregisterAutoScalingGroupTargetGroupExecute(r ApiDeregisterAutoScalingGroupTargetGroupRequest) (*AutoScalingGroupDetails, *http.Response, error) { +func (a *PubliccloudAPIService) DeleteVPSCredentialsExecute(r ApiDeleteVPSCredentialsRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AutoScalingGroupDetails ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeregisterAutoScalingGroupTargetGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteVPSCredentials") if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/autoScalingGroups/{autoScalingGroupId}/deregisterTargetGroup" - localVarPath = strings.Replace(localVarPath, "{"+"autoScalingGroupId"+"}", url.PathEscape(parameterValueToString(r.autoScalingGroupId, "autoScalingGroupId")), -1) + localVarPath := localBasePath + "/vps/{vpsId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.targetGroupIdOpts == nil { - return localVarReturnValue, nil, reportError("targetGroupIdOpts is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -4664,8 +4756,6 @@ func (a *PubliccloudAPIService) DeregisterAutoScalingGroupTargetGroupExecute(r A if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.targetGroupIdOpts if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -4682,19 +4772,19 @@ func (a *PubliccloudAPIService) DeregisterAutoScalingGroupTargetGroupExecute(r A } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -4702,144 +4792,117 @@ func (a *PubliccloudAPIService) DeregisterAutoScalingGroupTargetGroupExecute(r A body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResult - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 503 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiDeregisterTargetsRequest struct { +type ApiDeleteVPSSnapshotRequest struct { ctx context.Context ApiService PubliccloudAPI - targetGroupId string - requestBody *[]string -} - -func (r ApiDeregisterTargetsRequest) RequestBody(requestBody []string) ApiDeregisterTargetsRequest { - r.requestBody = &requestBody - return r + vpsId string + snapshotId string } -func (r ApiDeregisterTargetsRequest) Execute() (*http.Response, error) { - return r.ApiService.DeregisterTargetsExecute(r) +func (r ApiDeleteVPSSnapshotRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteVPSSnapshotExecute(r) } /* -DeregisterTargets Deregister Targets - -Deregister Targets in a Target Group +DeleteVPSSnapshot Delete VPS snapshot @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param targetGroupId Target Group ID - @return ApiDeregisterTargetsRequest + @param vpsId VPS ID + @param snapshotId + @return ApiDeleteVPSSnapshotRequest */ -func (a *PubliccloudAPIService) DeregisterTargets(ctx context.Context, targetGroupId string) ApiDeregisterTargetsRequest { - return ApiDeregisterTargetsRequest{ +func (a *PubliccloudAPIService) DeleteVPSSnapshot(ctx context.Context, vpsId string, snapshotId string) ApiDeleteVPSSnapshotRequest { + return ApiDeleteVPSSnapshotRequest{ ApiService: a, ctx: ctx, - targetGroupId: targetGroupId, + vpsId: vpsId, + snapshotId: snapshotId, } } // Execute executes the request -func (a *PubliccloudAPIService) DeregisterTargetsExecute(r ApiDeregisterTargetsRequest) (*http.Response, error) { +func (a *PubliccloudAPIService) DeleteVPSSnapshotExecute(r ApiDeleteVPSSnapshotRequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeregisterTargets") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeleteVPSSnapshot") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/targetGroups/{targetGroupId}/deregisterTargets" - localVarPath = strings.Replace(localVarPath, "{"+"targetGroupId"+"}", url.PathEscape(parameterValueToString(r.targetGroupId, "targetGroupId")), -1) + localVarPath := localBasePath + "/vps/{vpsId}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.requestBody == nil { - return nil, reportError("requestBody is required and must be specified") - } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -4855,8 +4918,6 @@ func (a *PubliccloudAPIService) DeregisterTargetsExecute(r ApiDeregisterTargetsR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.requestBody if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -4937,17 +4998,6 @@ func (a *PubliccloudAPIService) DeregisterTargetsExecute(r ApiDeregisterTargetsR newErr.model = v return localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 423 { - var v ErrorResult - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarHTTPResponse, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -4975,55 +5025,66 @@ func (a *PubliccloudAPIService) DeregisterTargetsExecute(r ApiDeregisterTargetsR return localVarHTTPResponse, nil } -type ApiDetachInstanceISORequest struct { +type ApiDeregisterAutoScalingGroupTargetGroupRequest struct { ctx context.Context ApiService PubliccloudAPI - instanceId string + autoScalingGroupId string + targetGroupIdOpts *TargetGroupIdOpts } -func (r ApiDetachInstanceISORequest) Execute() (*http.Response, error) { - return r.ApiService.DetachInstanceISOExecute(r) +func (r ApiDeregisterAutoScalingGroupTargetGroupRequest) TargetGroupIdOpts(targetGroupIdOpts TargetGroupIdOpts) ApiDeregisterAutoScalingGroupTargetGroupRequest { + r.targetGroupIdOpts = &targetGroupIdOpts + return r +} + +func (r ApiDeregisterAutoScalingGroupTargetGroupRequest) Execute() (*AutoScalingGroupDetails, *http.Response, error) { + return r.ApiService.DeregisterAutoScalingGroupTargetGroupExecute(r) } /* -DetachInstanceISO Detach ISO from a specific Instance +DeregisterAutoScalingGroupTargetGroup Deregister Target Group -Instance must have ISO attached, otherwise, it will return a validation error +Disassociate a target group from an Auto Scaling Group @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @return ApiDetachInstanceISORequest + @param autoScalingGroupId Auto Scaling Group ID + @return ApiDeregisterAutoScalingGroupTargetGroupRequest */ -func (a *PubliccloudAPIService) DetachInstanceISO(ctx context.Context, instanceId string) ApiDetachInstanceISORequest { - return ApiDetachInstanceISORequest{ +func (a *PubliccloudAPIService) DeregisterAutoScalingGroupTargetGroup(ctx context.Context, autoScalingGroupId string) ApiDeregisterAutoScalingGroupTargetGroupRequest { + return ApiDeregisterAutoScalingGroupTargetGroupRequest{ ApiService: a, ctx: ctx, - instanceId: instanceId, + autoScalingGroupId: autoScalingGroupId, } } // Execute executes the request -func (a *PubliccloudAPIService) DetachInstanceISOExecute(r ApiDetachInstanceISORequest) (*http.Response, error) { - var ( +// @return AutoScalingGroupDetails +func (a *PubliccloudAPIService) DeregisterAutoScalingGroupTargetGroupExecute(r ApiDeregisterAutoScalingGroupTargetGroupRequest) (*AutoScalingGroupDetails, *http.Response, error) { + var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile + localVarReturnValue *AutoScalingGroupDetails ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DetachInstanceISO") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeregisterAutoScalingGroupTargetGroup") if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/instances/{instanceId}/detachIso" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/autoScalingGroups/{autoScalingGroupId}/deregisterTargetGroup" + localVarPath = strings.Replace(localVarPath, "{"+"autoScalingGroupId"+"}", url.PathEscape(parameterValueToString(r.autoScalingGroupId, "autoScalingGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.targetGroupIdOpts == nil { + return localVarReturnValue, nil, reportError("targetGroupIdOpts is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -5039,6 +5100,8 @@ func (a *PubliccloudAPIService) DetachInstanceISOExecute(r ApiDetachInstanceISOR if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.targetGroupIdOpts if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -5055,19 +5118,19 @@ func (a *PubliccloudAPIService) DetachInstanceISOExecute(r ApiDetachInstanceISOR } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return nil, err + return localVarReturnValue, nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarHTTPResponse, err + return localVarReturnValue, localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -5080,121 +5143,139 @@ func (a *PubliccloudAPIService) DetachInstanceISOExecute(r ApiDetachInstanceISOR err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 503 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v } - return localVarHTTPResponse, newErr + return localVarReturnValue, localVarHTTPResponse, newErr } - return localVarHTTPResponse, nil + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil } -type ApiDetachVPSISORequest struct { +type ApiDeregisterTargetsRequest struct { ctx context.Context ApiService PubliccloudAPI - vpsId string + targetGroupId string + requestBody *[]string } -func (r ApiDetachVPSISORequest) Execute() (*http.Response, error) { - return r.ApiService.DetachVPSISOExecute(r) +func (r ApiDeregisterTargetsRequest) RequestBody(requestBody []string) ApiDeregisterTargetsRequest { + r.requestBody = &requestBody + return r +} + +func (r ApiDeregisterTargetsRequest) Execute() (*http.Response, error) { + return r.ApiService.DeregisterTargetsExecute(r) } /* -DetachVPSISO Detach ISO from a specific VPS +DeregisterTargets Deregister Targets -VPS must have ISO attached, otherwise, it will return a validation error +Deregister Targets in a Target Group @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param vpsId VPS ID - @return ApiDetachVPSISORequest + @param targetGroupId Target Group ID + @return ApiDeregisterTargetsRequest */ -func (a *PubliccloudAPIService) DetachVPSISO(ctx context.Context, vpsId string) ApiDetachVPSISORequest { - return ApiDetachVPSISORequest{ +func (a *PubliccloudAPIService) DeregisterTargets(ctx context.Context, targetGroupId string) ApiDeregisterTargetsRequest { + return ApiDeregisterTargetsRequest{ ApiService: a, ctx: ctx, - vpsId: vpsId, + targetGroupId: targetGroupId, } } // Execute executes the request -func (a *PubliccloudAPIService) DetachVPSISOExecute(r ApiDetachVPSISORequest) (*http.Response, error) { +func (a *PubliccloudAPIService) DeregisterTargetsExecute(r ApiDeregisterTargetsRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DetachVPSISO") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DeregisterTargets") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/vps/{vpsId}/detachIso" - localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) + localVarPath := localBasePath + "/targetGroups/{targetGroupId}/deregisterTargets" + localVarPath = strings.Replace(localVarPath, "{"+"targetGroupId"+"}", url.PathEscape(parameterValueToString(r.targetGroupId, "targetGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.requestBody == nil { + return nil, reportError("requestBody is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -5210,6 +5291,8 @@ func (a *PubliccloudAPIService) DetachVPSISOExecute(r ApiDetachVPSISORequest) (* if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.requestBody if r.ctx != nil { // API Key Authentication if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { @@ -5290,6 +5373,17 @@ func (a *PubliccloudAPIService) DetachVPSISOExecute(r ApiDetachVPSISORequest) (* newErr.model = v return localVarHTTPResponse, newErr } + if localVarHTTPResponse.StatusCode == 423 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -5317,50 +5411,48 @@ func (a *PubliccloudAPIService) DetachVPSISOExecute(r ApiDetachVPSISORequest) (* return localVarHTTPResponse, nil } -type ApiGetAutoScalingGroupRequest struct { +type ApiDetachInstanceISORequest struct { ctx context.Context ApiService PubliccloudAPI - autoScalingGroupId string + instanceId string } -func (r ApiGetAutoScalingGroupRequest) Execute() (*AutoScalingGroupDetails, *http.Response, error) { - return r.ApiService.GetAutoScalingGroupExecute(r) +func (r ApiDetachInstanceISORequest) Execute() (*http.Response, error) { + return r.ApiService.DetachInstanceISOExecute(r) } /* -GetAutoScalingGroup Get Auto Scaling Group details +DetachInstanceISO Detach ISO from a specific Instance -Get details about Auto Scaling Group. +Instance must have ISO attached, otherwise, it will return a validation error @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param autoScalingGroupId Auto Scaling Group ID - @return ApiGetAutoScalingGroupRequest + @param instanceId Instance's ID + @return ApiDetachInstanceISORequest */ -func (a *PubliccloudAPIService) GetAutoScalingGroup(ctx context.Context, autoScalingGroupId string) ApiGetAutoScalingGroupRequest { - return ApiGetAutoScalingGroupRequest{ +func (a *PubliccloudAPIService) DetachInstanceISO(ctx context.Context, instanceId string) ApiDetachInstanceISORequest { + return ApiDetachInstanceISORequest{ ApiService: a, ctx: ctx, - autoScalingGroupId: autoScalingGroupId, + instanceId: instanceId, } } // Execute executes the request -// @return AutoScalingGroupDetails -func (a *PubliccloudAPIService) GetAutoScalingGroupExecute(r ApiGetAutoScalingGroupRequest) (*AutoScalingGroupDetails, *http.Response, error) { +func (a *PubliccloudAPIService) DetachInstanceISOExecute(r ApiDetachInstanceISORequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *AutoScalingGroupDetails ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetAutoScalingGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DetachInstanceISO") if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/autoScalingGroups/{autoScalingGroupId}" - localVarPath = strings.Replace(localVarPath, "{"+"autoScalingGroupId"+"}", url.PathEscape(parameterValueToString(r.autoScalingGroupId, "autoScalingGroupId")), -1) + localVarPath := localBasePath + "/instances/{instanceId}/detachIso" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -5399,19 +5491,19 @@ func (a *PubliccloudAPIService) GetAutoScalingGroupExecute(r ApiGetAutoScalingGr } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -5424,150 +5516,119 @@ func (a *PubliccloudAPIService) GetAutoScalingGroupExecute(r ApiGetAutoScalingGr err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 503 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiGetAutoScalingGroupInstanceListRequest struct { +type ApiDetachVPSISORequest struct { ctx context.Context ApiService PubliccloudAPI - autoScalingGroupId string - limit *int32 - offset *int32 -} - -// Limit the number of results returned. -func (r ApiGetAutoScalingGroupInstanceListRequest) Limit(limit int32) ApiGetAutoScalingGroupInstanceListRequest { - r.limit = &limit - return r -} - -// Return results starting from the given offset. -func (r ApiGetAutoScalingGroupInstanceListRequest) Offset(offset int32) ApiGetAutoScalingGroupInstanceListRequest { - r.offset = &offset - return r + vpsId string } -func (r ApiGetAutoScalingGroupInstanceListRequest) Execute() (*GetAutoScalingGroupInstanceListResult, *http.Response, error) { - return r.ApiService.GetAutoScalingGroupInstanceListExecute(r) +func (r ApiDetachVPSISORequest) Execute() (*http.Response, error) { + return r.ApiService.DetachVPSISOExecute(r) } /* -GetAutoScalingGroupInstanceList Get list of instances belonging to an Auto Scaling Group +DetachVPSISO Detach ISO from a specific VPS -List instances belonging to an Auto Scaling Group +VPS must have ISO attached, otherwise, it will return a validation error @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param autoScalingGroupId Auto Scaling Group ID - @return ApiGetAutoScalingGroupInstanceListRequest + @param vpsId VPS ID + @return ApiDetachVPSISORequest */ -func (a *PubliccloudAPIService) GetAutoScalingGroupInstanceList(ctx context.Context, autoScalingGroupId string) ApiGetAutoScalingGroupInstanceListRequest { - return ApiGetAutoScalingGroupInstanceListRequest{ +func (a *PubliccloudAPIService) DetachVPSISO(ctx context.Context, vpsId string) ApiDetachVPSISORequest { + return ApiDetachVPSISORequest{ ApiService: a, ctx: ctx, - autoScalingGroupId: autoScalingGroupId, + vpsId: vpsId, } } // Execute executes the request -// @return GetAutoScalingGroupInstanceListResult -func (a *PubliccloudAPIService) GetAutoScalingGroupInstanceListExecute(r ApiGetAutoScalingGroupInstanceListRequest) (*GetAutoScalingGroupInstanceListResult, *http.Response, error) { +func (a *PubliccloudAPIService) DetachVPSISOExecute(r ApiDetachVPSISORequest) (*http.Response, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPost localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetAutoScalingGroupInstanceListResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetAutoScalingGroupInstanceList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.DetachVPSISO") if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + return nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/autoScalingGroups/{autoScalingGroupId}/instances" - localVarPath = strings.Replace(localVarPath, "{"+"autoScalingGroupId"+"}", url.PathEscape(parameterValueToString(r.autoScalingGroupId, "autoScalingGroupId")), -1) + localVarPath := localBasePath + "/vps/{vpsId}/detachIso" + localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -5601,19 +5662,19 @@ func (a *PubliccloudAPIService) GetAutoScalingGroupInstanceListExecute(r ApiGetA } req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return localVarReturnValue, nil, err + return nil, err } localVarHTTPResponse, err := a.client.callAPI(req) if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return localVarReturnValue, localVarHTTPResponse, err + return localVarHTTPResponse, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -5626,204 +5687,121 @@ func (a *PubliccloudAPIService) GetAutoScalingGroupInstanceListExecute(r ApiGetA err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 403 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 404 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } if localVarHTTPResponse.StatusCode == 503 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) newErr.model = v } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr + return localVarHTTPResponse, newErr } - return localVarReturnValue, localVarHTTPResponse, nil + return localVarHTTPResponse, nil } -type ApiGetAutoScalingGroupListRequest struct { +type ApiGetAutoScalingGroupRequest struct { ctx context.Context ApiService PubliccloudAPI - limit *int32 - offset *int32 - id *string - instanceId *string - type_ *string - region *RegionName - reference *string - state *string -} - -// Limit the number of results returned. -func (r ApiGetAutoScalingGroupListRequest) Limit(limit int32) ApiGetAutoScalingGroupListRequest { - r.limit = &limit - return r -} - -// Return results starting from the given offset. -func (r ApiGetAutoScalingGroupListRequest) Offset(offset int32) ApiGetAutoScalingGroupListRequest { - r.offset = &offset - return r -} - -func (r ApiGetAutoScalingGroupListRequest) Id(id string) ApiGetAutoScalingGroupListRequest { - r.id = &id - return r -} - -func (r ApiGetAutoScalingGroupListRequest) InstanceId(instanceId string) ApiGetAutoScalingGroupListRequest { - r.instanceId = &instanceId - return r -} - -// The Auto Scaling Group's type -func (r ApiGetAutoScalingGroupListRequest) Type_(type_ string) ApiGetAutoScalingGroupListRequest { - r.type_ = &type_ - return r -} - -// The region in which the Auto Scaling Group was created -func (r ApiGetAutoScalingGroupListRequest) Region(region RegionName) ApiGetAutoScalingGroupListRequest { - r.region = ®ion - return r -} - -// The reference used to identify identifies the Auto Scaling Group -func (r ApiGetAutoScalingGroupListRequest) Reference(reference string) ApiGetAutoScalingGroupListRequest { - r.reference = &reference - return r -} - -// The Auto Scaling Group's current state -func (r ApiGetAutoScalingGroupListRequest) State(state string) ApiGetAutoScalingGroupListRequest { - r.state = &state - return r + autoScalingGroupId string } -func (r ApiGetAutoScalingGroupListRequest) Execute() (*GetAutoScalingGroupListResult, *http.Response, error) { - return r.ApiService.GetAutoScalingGroupListExecute(r) +func (r ApiGetAutoScalingGroupRequest) Execute() (*AutoScalingGroupDetails, *http.Response, error) { + return r.ApiService.GetAutoScalingGroupExecute(r) } /* -GetAutoScalingGroupList Get Auto Scaling Group list +GetAutoScalingGroup Get Auto Scaling Group details -List and filter Auto Scaling Groups +Get details about Auto Scaling Group. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetAutoScalingGroupListRequest + @param autoScalingGroupId Auto Scaling Group ID + @return ApiGetAutoScalingGroupRequest */ -func (a *PubliccloudAPIService) GetAutoScalingGroupList(ctx context.Context) ApiGetAutoScalingGroupListRequest { - return ApiGetAutoScalingGroupListRequest{ +func (a *PubliccloudAPIService) GetAutoScalingGroup(ctx context.Context, autoScalingGroupId string) ApiGetAutoScalingGroupRequest { + return ApiGetAutoScalingGroupRequest{ ApiService: a, ctx: ctx, + autoScalingGroupId: autoScalingGroupId, } } // Execute executes the request -// @return GetAutoScalingGroupListResult -func (a *PubliccloudAPIService) GetAutoScalingGroupListExecute(r ApiGetAutoScalingGroupListRequest) (*GetAutoScalingGroupListResult, *http.Response, error) { +// @return AutoScalingGroupDetails +func (a *PubliccloudAPIService) GetAutoScalingGroupExecute(r ApiGetAutoScalingGroupRequest) (*AutoScalingGroupDetails, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetAutoScalingGroupListResult + localVarReturnValue *AutoScalingGroupDetails ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetAutoScalingGroupList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetAutoScalingGroup") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/autoScalingGroups" + localVarPath := localBasePath + "/autoScalingGroups/{autoScalingGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"autoScalingGroupId"+"}", url.PathEscape(parameterValueToString(r.autoScalingGroupId, "autoScalingGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.id != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "id", r.id, "form", "") - } - if r.instanceId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "instanceId", r.instanceId, "form", "") - } - if r.type_ != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "form", "") - } - if r.region != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "region", r.region, "form", "") - } - if r.reference != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "reference", r.reference, "form", "") - } - if r.state != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "state", r.state, "form", "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -5910,6 +5888,17 @@ func (a *PubliccloudAPIService) GetAutoScalingGroupListExecute(r ApiGetAutoScali newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -5946,82 +5935,74 @@ func (a *PubliccloudAPIService) GetAutoScalingGroupListExecute(r ApiGetAutoScali return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetConnectionsMetricsRequest struct { +type ApiGetAutoScalingGroupInstanceListRequest struct { ctx context.Context ApiService PubliccloudAPI - loadBalancerId string - from *string - to *string - granularity *string -} - -// The start of the interval to get the metric -func (r ApiGetConnectionsMetricsRequest) From(from string) ApiGetConnectionsMetricsRequest { - r.from = &from - return r + autoScalingGroupId string + limit *int32 + offset *int32 } -// The end of the interval to get the metric. Must be greater than the date provided in `from` -func (r ApiGetConnectionsMetricsRequest) To(to string) ApiGetConnectionsMetricsRequest { - r.to = &to +// Limit the number of results returned. +func (r ApiGetAutoScalingGroupInstanceListRequest) Limit(limit int32) ApiGetAutoScalingGroupInstanceListRequest { + r.limit = &limit return r } -// The interval for each metric -func (r ApiGetConnectionsMetricsRequest) Granularity(granularity string) ApiGetConnectionsMetricsRequest { - r.granularity = &granularity +// Return results starting from the given offset. +func (r ApiGetAutoScalingGroupInstanceListRequest) Offset(offset int32) ApiGetAutoScalingGroupInstanceListRequest { + r.offset = &offset return r } -func (r ApiGetConnectionsMetricsRequest) Execute() (*GetConnectionsMetricsResult, *http.Response, error) { - return r.ApiService.GetConnectionsMetricsExecute(r) +func (r ApiGetAutoScalingGroupInstanceListRequest) Execute() (*GetAutoScalingGroupInstanceListResult, *http.Response, error) { + return r.ApiService.GetAutoScalingGroupInstanceListExecute(r) } /* -GetConnectionsMetrics Get connections metrics +GetAutoScalingGroupInstanceList Get list of instances belonging to an Auto Scaling Group + +List instances belonging to an Auto Scaling Group @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param loadBalancerId Load balancer ID - @return ApiGetConnectionsMetricsRequest + @param autoScalingGroupId Auto Scaling Group ID + @return ApiGetAutoScalingGroupInstanceListRequest */ -func (a *PubliccloudAPIService) GetConnectionsMetrics(ctx context.Context, loadBalancerId string) ApiGetConnectionsMetricsRequest { - return ApiGetConnectionsMetricsRequest{ +func (a *PubliccloudAPIService) GetAutoScalingGroupInstanceList(ctx context.Context, autoScalingGroupId string) ApiGetAutoScalingGroupInstanceListRequest { + return ApiGetAutoScalingGroupInstanceListRequest{ ApiService: a, ctx: ctx, - loadBalancerId: loadBalancerId, + autoScalingGroupId: autoScalingGroupId, } } // Execute executes the request -// @return GetConnectionsMetricsResult -func (a *PubliccloudAPIService) GetConnectionsMetricsExecute(r ApiGetConnectionsMetricsRequest) (*GetConnectionsMetricsResult, *http.Response, error) { +// @return GetAutoScalingGroupInstanceListResult +func (a *PubliccloudAPIService) GetAutoScalingGroupInstanceListExecute(r ApiGetAutoScalingGroupInstanceListRequest) (*GetAutoScalingGroupInstanceListResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetConnectionsMetricsResult + localVarReturnValue *GetAutoScalingGroupInstanceListResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetConnectionsMetrics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetAutoScalingGroupInstanceList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/connections" - localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) + localVarPath := localBasePath + "/autoScalingGroups/{autoScalingGroupId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"autoScalingGroupId"+"}", url.PathEscape(parameterValueToString(r.autoScalingGroupId, "autoScalingGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.from != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") - } - if r.to != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") } - if r.granularity != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -6156,82 +6137,128 @@ func (a *PubliccloudAPIService) GetConnectionsMetricsExecute(r ApiGetConnections return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetConnectionsPerSecondMetricsRequest struct { +type ApiGetAutoScalingGroupListRequest struct { ctx context.Context ApiService PubliccloudAPI - loadBalancerId string - from *string - to *string - granularity *string + limit *int32 + offset *int32 + id *string + instanceId *string + type_ *string + region *RegionName + reference *string + state *string } -// The start of the interval to get the metric -func (r ApiGetConnectionsPerSecondMetricsRequest) From(from string) ApiGetConnectionsPerSecondMetricsRequest { - r.from = &from +// Limit the number of results returned. +func (r ApiGetAutoScalingGroupListRequest) Limit(limit int32) ApiGetAutoScalingGroupListRequest { + r.limit = &limit return r } -// The end of the interval to get the metric. Must be greater than the date provided in `from` -func (r ApiGetConnectionsPerSecondMetricsRequest) To(to string) ApiGetConnectionsPerSecondMetricsRequest { - r.to = &to +// Return results starting from the given offset. +func (r ApiGetAutoScalingGroupListRequest) Offset(offset int32) ApiGetAutoScalingGroupListRequest { + r.offset = &offset return r } -// The interval for each metric -func (r ApiGetConnectionsPerSecondMetricsRequest) Granularity(granularity string) ApiGetConnectionsPerSecondMetricsRequest { - r.granularity = &granularity +func (r ApiGetAutoScalingGroupListRequest) Id(id string) ApiGetAutoScalingGroupListRequest { + r.id = &id return r } -func (r ApiGetConnectionsPerSecondMetricsRequest) Execute() (*GetConnectionsPerSecondMetricsResult, *http.Response, error) { - return r.ApiService.GetConnectionsPerSecondMetricsExecute(r) +func (r ApiGetAutoScalingGroupListRequest) InstanceId(instanceId string) ApiGetAutoScalingGroupListRequest { + r.instanceId = &instanceId + return r } -/* -GetConnectionsPerSecondMetrics Get connections per second metrics +// The Auto Scaling Group's type +func (r ApiGetAutoScalingGroupListRequest) Type_(type_ string) ApiGetAutoScalingGroupListRequest { + r.type_ = &type_ + return r +} + +// The region in which the Auto Scaling Group was created +func (r ApiGetAutoScalingGroupListRequest) Region(region RegionName) ApiGetAutoScalingGroupListRequest { + r.region = ®ion + return r +} + +// The reference used to identify identifies the Auto Scaling Group +func (r ApiGetAutoScalingGroupListRequest) Reference(reference string) ApiGetAutoScalingGroupListRequest { + r.reference = &reference + return r +} + +// The Auto Scaling Group's current state +func (r ApiGetAutoScalingGroupListRequest) State(state string) ApiGetAutoScalingGroupListRequest { + r.state = &state + return r +} + +func (r ApiGetAutoScalingGroupListRequest) Execute() (*GetAutoScalingGroupListResult, *http.Response, error) { + return r.ApiService.GetAutoScalingGroupListExecute(r) +} + +/* +GetAutoScalingGroupList Get Auto Scaling Group list + +List and filter Auto Scaling Groups @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param loadBalancerId Load balancer ID - @return ApiGetConnectionsPerSecondMetricsRequest + @return ApiGetAutoScalingGroupListRequest */ -func (a *PubliccloudAPIService) GetConnectionsPerSecondMetrics(ctx context.Context, loadBalancerId string) ApiGetConnectionsPerSecondMetricsRequest { - return ApiGetConnectionsPerSecondMetricsRequest{ +func (a *PubliccloudAPIService) GetAutoScalingGroupList(ctx context.Context) ApiGetAutoScalingGroupListRequest { + return ApiGetAutoScalingGroupListRequest{ ApiService: a, ctx: ctx, - loadBalancerId: loadBalancerId, } } // Execute executes the request -// @return GetConnectionsPerSecondMetricsResult -func (a *PubliccloudAPIService) GetConnectionsPerSecondMetricsExecute(r ApiGetConnectionsPerSecondMetricsRequest) (*GetConnectionsPerSecondMetricsResult, *http.Response, error) { +// @return GetAutoScalingGroupListResult +func (a *PubliccloudAPIService) GetAutoScalingGroupListExecute(r ApiGetAutoScalingGroupListRequest) (*GetAutoScalingGroupListResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetConnectionsPerSecondMetricsResult + localVarReturnValue *GetAutoScalingGroupListResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetConnectionsPerSecondMetrics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetAutoScalingGroupList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/connectionsPerSecond" - localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) + localVarPath := localBasePath + "/autoScalingGroups" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.from != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") } - if r.to != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } - if r.granularity != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") + if r.id != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", r.id, "form", "") + } + if r.instanceId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "instanceId", r.instanceId, "form", "") + } + if r.type_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "form", "") + } + if r.region != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", r.region, "form", "") + } + if r.reference != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "reference", r.reference, "form", "") + } + if r.state != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "state", r.state, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -6319,17 +6346,6 @@ func (a *PubliccloudAPIService) GetConnectionsPerSecondMetricsExecute(r ApiGetCo newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { - var v ErrorResult - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -6366,55 +6382,83 @@ func (a *PubliccloudAPIService) GetConnectionsPerSecondMetricsExecute(r ApiGetCo return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetConsoleAccessToInstanceRequest struct { +type ApiGetConnectionsMetricsRequest struct { ctx context.Context ApiService PubliccloudAPI - instanceId string + loadBalancerId string + from *string + to *string + granularity *string } -func (r ApiGetConsoleAccessToInstanceRequest) Execute() (*GetConsoleAccessToInstanceResult, *http.Response, error) { - return r.ApiService.GetConsoleAccessToInstanceExecute(r) +// The start of the interval to get the metric +func (r ApiGetConnectionsMetricsRequest) From(from string) ApiGetConnectionsMetricsRequest { + r.from = &from + return r } -/* -GetConsoleAccessToInstance Get console access +// The end of the interval to get the metric. Must be greater than the date provided in `from` +func (r ApiGetConnectionsMetricsRequest) To(to string) ApiGetConnectionsMetricsRequest { + r.to = &to + return r +} -Get console access to the instance +// The interval for each metric +func (r ApiGetConnectionsMetricsRequest) Granularity(granularity string) ApiGetConnectionsMetricsRequest { + r.granularity = &granularity + return r +} + +func (r ApiGetConnectionsMetricsRequest) Execute() (*GetConnectionsMetricsResult, *http.Response, error) { + return r.ApiService.GetConnectionsMetricsExecute(r) +} + +/* +GetConnectionsMetrics Get connections metrics @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @return ApiGetConsoleAccessToInstanceRequest + @param loadBalancerId Load balancer ID + @return ApiGetConnectionsMetricsRequest */ -func (a *PubliccloudAPIService) GetConsoleAccessToInstance(ctx context.Context, instanceId string) ApiGetConsoleAccessToInstanceRequest { - return ApiGetConsoleAccessToInstanceRequest{ +func (a *PubliccloudAPIService) GetConnectionsMetrics(ctx context.Context, loadBalancerId string) ApiGetConnectionsMetricsRequest { + return ApiGetConnectionsMetricsRequest{ ApiService: a, ctx: ctx, - instanceId: instanceId, + loadBalancerId: loadBalancerId, } } // Execute executes the request -// @return GetConsoleAccessToInstanceResult -func (a *PubliccloudAPIService) GetConsoleAccessToInstanceExecute(r ApiGetConsoleAccessToInstanceRequest) (*GetConsoleAccessToInstanceResult, *http.Response, error) { +// @return GetConnectionsMetricsResult +func (a *PubliccloudAPIService) GetConnectionsMetricsExecute(r ApiGetConnectionsMetricsRequest) (*GetConnectionsMetricsResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetConsoleAccessToInstanceResult + localVarReturnValue *GetConnectionsMetricsResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetConsoleAccessToInstance") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetConnectionsMetrics") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/instances/{instanceId}/console" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/connections" + localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.from != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") + } + if r.to != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + } + if r.granularity != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -6548,69 +6592,69 @@ func (a *PubliccloudAPIService) GetConsoleAccessToInstanceExecute(r ApiGetConsol return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetCpuMetricsRequest struct { +type ApiGetConnectionsPerSecondMetricsRequest struct { ctx context.Context ApiService PubliccloudAPI - instanceId string + loadBalancerId string from *string to *string - granularity *MetricsGranularity + granularity *string } // The start of the interval to get the metric -func (r ApiGetCpuMetricsRequest) From(from string) ApiGetCpuMetricsRequest { +func (r ApiGetConnectionsPerSecondMetricsRequest) From(from string) ApiGetConnectionsPerSecondMetricsRequest { r.from = &from return r } // The end of the interval to get the metric. Must be greater than the date provided in `from` -func (r ApiGetCpuMetricsRequest) To(to string) ApiGetCpuMetricsRequest { +func (r ApiGetConnectionsPerSecondMetricsRequest) To(to string) ApiGetConnectionsPerSecondMetricsRequest { r.to = &to return r } // The interval for each metric -func (r ApiGetCpuMetricsRequest) Granularity(granularity MetricsGranularity) ApiGetCpuMetricsRequest { +func (r ApiGetConnectionsPerSecondMetricsRequest) Granularity(granularity string) ApiGetConnectionsPerSecondMetricsRequest { r.granularity = &granularity return r } -func (r ApiGetCpuMetricsRequest) Execute() (*GetCpuMetricsResult, *http.Response, error) { - return r.ApiService.GetCpuMetricsExecute(r) +func (r ApiGetConnectionsPerSecondMetricsRequest) Execute() (*GetConnectionsPerSecondMetricsResult, *http.Response, error) { + return r.ApiService.GetConnectionsPerSecondMetricsExecute(r) } /* -GetCpuMetrics Get instance CPU metrics +GetConnectionsPerSecondMetrics Get connections per second metrics @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @return ApiGetCpuMetricsRequest + @param loadBalancerId Load balancer ID + @return ApiGetConnectionsPerSecondMetricsRequest */ -func (a *PubliccloudAPIService) GetCpuMetrics(ctx context.Context, instanceId string) ApiGetCpuMetricsRequest { - return ApiGetCpuMetricsRequest{ +func (a *PubliccloudAPIService) GetConnectionsPerSecondMetrics(ctx context.Context, loadBalancerId string) ApiGetConnectionsPerSecondMetricsRequest { + return ApiGetConnectionsPerSecondMetricsRequest{ ApiService: a, ctx: ctx, - instanceId: instanceId, + loadBalancerId: loadBalancerId, } } // Execute executes the request -// @return GetCpuMetricsResult -func (a *PubliccloudAPIService) GetCpuMetricsExecute(r ApiGetCpuMetricsRequest) (*GetCpuMetricsResult, *http.Response, error) { +// @return GetConnectionsPerSecondMetricsResult +func (a *PubliccloudAPIService) GetConnectionsPerSecondMetricsExecute(r ApiGetConnectionsPerSecondMetricsRequest) (*GetConnectionsPerSecondMetricsResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetCpuMetricsResult + localVarReturnValue *GetConnectionsPerSecondMetricsResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetCpuMetrics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetConnectionsPerSecondMetrics") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/instances/{instanceId}/metrics/cpu" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/connectionsPerSecond" + localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6758,69 +6802,69 @@ func (a *PubliccloudAPIService) GetCpuMetricsExecute(r ApiGetCpuMetricsRequest) return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetDataTransferredMetricsRequest struct { +type ApiGetCpuMetricsRequest struct { ctx context.Context ApiService PubliccloudAPI - loadBalancerId string + instanceId string from *string to *string granularity *MetricsGranularity } // The start of the interval to get the metric -func (r ApiGetDataTransferredMetricsRequest) From(from string) ApiGetDataTransferredMetricsRequest { +func (r ApiGetCpuMetricsRequest) From(from string) ApiGetCpuMetricsRequest { r.from = &from return r } // The end of the interval to get the metric. Must be greater than the date provided in `from` -func (r ApiGetDataTransferredMetricsRequest) To(to string) ApiGetDataTransferredMetricsRequest { +func (r ApiGetCpuMetricsRequest) To(to string) ApiGetCpuMetricsRequest { r.to = &to return r } // The interval for each metric -func (r ApiGetDataTransferredMetricsRequest) Granularity(granularity MetricsGranularity) ApiGetDataTransferredMetricsRequest { +func (r ApiGetCpuMetricsRequest) Granularity(granularity MetricsGranularity) ApiGetCpuMetricsRequest { r.granularity = &granularity return r } -func (r ApiGetDataTransferredMetricsRequest) Execute() (*GetDataTransferredMetricsResult, *http.Response, error) { - return r.ApiService.GetDataTransferredMetricsExecute(r) +func (r ApiGetCpuMetricsRequest) Execute() (*GetCpuMetricsResult, *http.Response, error) { + return r.ApiService.GetCpuMetricsExecute(r) } /* -GetDataTransferredMetrics Get load balancer data transferred metrics +GetCpuMetrics Get instance CPU metrics @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param loadBalancerId Load balancer ID - @return ApiGetDataTransferredMetricsRequest + @param instanceId Instance's ID + @return ApiGetCpuMetricsRequest */ -func (a *PubliccloudAPIService) GetDataTransferredMetrics(ctx context.Context, loadBalancerId string) ApiGetDataTransferredMetricsRequest { - return ApiGetDataTransferredMetricsRequest{ +func (a *PubliccloudAPIService) GetCpuMetrics(ctx context.Context, instanceId string) ApiGetCpuMetricsRequest { + return ApiGetCpuMetricsRequest{ ApiService: a, ctx: ctx, - loadBalancerId: loadBalancerId, + instanceId: instanceId, } } // Execute executes the request -// @return GetDataTransferredMetricsResult -func (a *PubliccloudAPIService) GetDataTransferredMetricsExecute(r ApiGetDataTransferredMetricsRequest) (*GetDataTransferredMetricsResult, *http.Response, error) { +// @return GetCpuMetricsResult +func (a *PubliccloudAPIService) GetCpuMetricsExecute(r ApiGetCpuMetricsRequest) (*GetCpuMetricsResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetDataTransferredMetricsResult + localVarReturnValue *GetCpuMetricsResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetDataTransferredMetrics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetCpuMetrics") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/dataTransferred" - localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) + localVarPath := localBasePath + "/instances/{instanceId}/metrics/cpu" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -6968,7 +7012,7 @@ func (a *PubliccloudAPIService) GetDataTransferredMetricsExecute(r ApiGetDataTra return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetDataTransferredPerSecondMetricsRequest struct { +type ApiGetDataTransferredMetricsRequest struct { ctx context.Context ApiService PubliccloudAPI loadBalancerId string @@ -6978,36 +7022,36 @@ type ApiGetDataTransferredPerSecondMetricsRequest struct { } // The start of the interval to get the metric -func (r ApiGetDataTransferredPerSecondMetricsRequest) From(from string) ApiGetDataTransferredPerSecondMetricsRequest { +func (r ApiGetDataTransferredMetricsRequest) From(from string) ApiGetDataTransferredMetricsRequest { r.from = &from return r } // The end of the interval to get the metric. Must be greater than the date provided in `from` -func (r ApiGetDataTransferredPerSecondMetricsRequest) To(to string) ApiGetDataTransferredPerSecondMetricsRequest { +func (r ApiGetDataTransferredMetricsRequest) To(to string) ApiGetDataTransferredMetricsRequest { r.to = &to return r } // The interval for each metric -func (r ApiGetDataTransferredPerSecondMetricsRequest) Granularity(granularity MetricsGranularity) ApiGetDataTransferredPerSecondMetricsRequest { +func (r ApiGetDataTransferredMetricsRequest) Granularity(granularity MetricsGranularity) ApiGetDataTransferredMetricsRequest { r.granularity = &granularity return r } -func (r ApiGetDataTransferredPerSecondMetricsRequest) Execute() (*GetDataTransferredPerSecondMetricsResult, *http.Response, error) { - return r.ApiService.GetDataTransferredPerSecondMetricsExecute(r) +func (r ApiGetDataTransferredMetricsRequest) Execute() (*GetDataTransferredMetricsResult, *http.Response, error) { + return r.ApiService.GetDataTransferredMetricsExecute(r) } /* -GetDataTransferredPerSecondMetrics Get load balancer data transferred per second metrics +GetDataTransferredMetrics Get load balancer data transferred metrics @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param loadBalancerId Load balancer ID - @return ApiGetDataTransferredPerSecondMetricsRequest + @return ApiGetDataTransferredMetricsRequest */ -func (a *PubliccloudAPIService) GetDataTransferredPerSecondMetrics(ctx context.Context, loadBalancerId string) ApiGetDataTransferredPerSecondMetricsRequest { - return ApiGetDataTransferredPerSecondMetricsRequest{ +func (a *PubliccloudAPIService) GetDataTransferredMetrics(ctx context.Context, loadBalancerId string) ApiGetDataTransferredMetricsRequest { + return ApiGetDataTransferredMetricsRequest{ ApiService: a, ctx: ctx, loadBalancerId: loadBalancerId, @@ -7015,21 +7059,21 @@ func (a *PubliccloudAPIService) GetDataTransferredPerSecondMetrics(ctx context.C } // Execute executes the request -// @return GetDataTransferredPerSecondMetricsResult -func (a *PubliccloudAPIService) GetDataTransferredPerSecondMetricsExecute(r ApiGetDataTransferredPerSecondMetricsRequest) (*GetDataTransferredPerSecondMetricsResult, *http.Response, error) { +// @return GetDataTransferredMetricsResult +func (a *PubliccloudAPIService) GetDataTransferredMetricsExecute(r ApiGetDataTransferredMetricsRequest) (*GetDataTransferredMetricsResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetDataTransferredPerSecondMetricsResult + localVarReturnValue *GetDataTransferredMetricsResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetDataTransferredPerSecondMetrics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetDataTransferredMetrics") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/dataTransferredPerSecond" + localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/dataTransferred" localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) localVarHeaderParams := make(map[string]string) @@ -7178,10 +7222,220 @@ func (a *PubliccloudAPIService) GetDataTransferredPerSecondMetricsExecute(r ApiG return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetExpensesRequest struct { +type ApiGetDataTransferredPerSecondMetricsRequest struct { ctx context.Context ApiService PubliccloudAPI - equipmentId string + loadBalancerId string + from *string + to *string + granularity *MetricsGranularity +} + +// The start of the interval to get the metric +func (r ApiGetDataTransferredPerSecondMetricsRequest) From(from string) ApiGetDataTransferredPerSecondMetricsRequest { + r.from = &from + return r +} + +// The end of the interval to get the metric. Must be greater than the date provided in `from` +func (r ApiGetDataTransferredPerSecondMetricsRequest) To(to string) ApiGetDataTransferredPerSecondMetricsRequest { + r.to = &to + return r +} + +// The interval for each metric +func (r ApiGetDataTransferredPerSecondMetricsRequest) Granularity(granularity MetricsGranularity) ApiGetDataTransferredPerSecondMetricsRequest { + r.granularity = &granularity + return r +} + +func (r ApiGetDataTransferredPerSecondMetricsRequest) Execute() (*GetDataTransferredPerSecondMetricsResult, *http.Response, error) { + return r.ApiService.GetDataTransferredPerSecondMetricsExecute(r) +} + +/* +GetDataTransferredPerSecondMetrics Get load balancer data transferred per second metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param loadBalancerId Load balancer ID + @return ApiGetDataTransferredPerSecondMetricsRequest +*/ +func (a *PubliccloudAPIService) GetDataTransferredPerSecondMetrics(ctx context.Context, loadBalancerId string) ApiGetDataTransferredPerSecondMetricsRequest { + return ApiGetDataTransferredPerSecondMetricsRequest{ + ApiService: a, + ctx: ctx, + loadBalancerId: loadBalancerId, + } +} + +// Execute executes the request +// @return GetDataTransferredPerSecondMetricsResult +func (a *PubliccloudAPIService) GetDataTransferredPerSecondMetricsExecute(r ApiGetDataTransferredPerSecondMetricsRequest) (*GetDataTransferredPerSecondMetricsResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetDataTransferredPerSecondMetricsResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetDataTransferredPerSecondMetrics") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/dataTransferredPerSecond" + localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.from != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") + } + if r.to != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + } + if r.granularity != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["X-LSW-Auth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-LSW-Auth"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetExpensesRequest struct { + ctx context.Context + ApiService PubliccloudAPI + equipmentId string from *string to *string } @@ -7782,56 +8036,50 @@ func (a *PubliccloudAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*In return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetInstanceCredentialRequest struct { +type ApiGetInstanceConsoleAccessRequest struct { ctx context.Context ApiService PubliccloudAPI instanceId string - type_ CredentialType - username string } -func (r ApiGetInstanceCredentialRequest) Execute() (*GetCredentialResult, *http.Response, error) { - return r.ApiService.GetInstanceCredentialExecute(r) +func (r ApiGetInstanceConsoleAccessRequest) Execute() (*GetConsoleAccessResult, *http.Response, error) { + return r.ApiService.GetInstanceConsoleAccessExecute(r) } /* -GetInstanceCredential Get Instance credentials by type and username. +GetInstanceConsoleAccess Get console access + +Get console access to the instance @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId Instance's ID - @param type_ Type of credential - @param username Username - @return ApiGetInstanceCredentialRequest + @return ApiGetInstanceConsoleAccessRequest */ -func (a *PubliccloudAPIService) GetInstanceCredential(ctx context.Context, instanceId string, type_ CredentialType, username string) ApiGetInstanceCredentialRequest { - return ApiGetInstanceCredentialRequest{ +func (a *PubliccloudAPIService) GetInstanceConsoleAccess(ctx context.Context, instanceId string) ApiGetInstanceConsoleAccessRequest { + return ApiGetInstanceConsoleAccessRequest{ ApiService: a, ctx: ctx, instanceId: instanceId, - type_: type_, - username: username, } } // Execute executes the request -// @return GetCredentialResult -func (a *PubliccloudAPIService) GetInstanceCredentialExecute(r ApiGetInstanceCredentialRequest) (*GetCredentialResult, *http.Response, error) { +// @return GetConsoleAccessResult +func (a *PubliccloudAPIService) GetInstanceConsoleAccessExecute(r ApiGetInstanceConsoleAccessRequest) (*GetConsoleAccessResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetCredentialResult + localVarReturnValue *GetConsoleAccessResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetInstanceCredential") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetInstanceConsoleAccess") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/instances/{instanceId}/credentials/{type}/{username}" + localVarPath := localBasePath + "/instances/{instanceId}/console" localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", url.PathEscape(parameterValueToString(r.type_, "type_")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -7970,34 +8218,222 @@ func (a *PubliccloudAPIService) GetInstanceCredentialExecute(r ApiGetInstanceCre return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetInstanceCredentialListRequest struct { +type ApiGetInstanceCredentialRequest struct { ctx context.Context ApiService PubliccloudAPI instanceId string + type_ CredentialType + username string } -func (r ApiGetInstanceCredentialListRequest) Execute() (*GetCredentialListResult, *http.Response, error) { - return r.ApiService.GetInstanceCredentialListExecute(r) +func (r ApiGetInstanceCredentialRequest) Execute() (*GetCredentialResult, *http.Response, error) { + return r.ApiService.GetInstanceCredentialExecute(r) } /* -GetInstanceCredentialList List credentials stored for a specific Instance +GetInstanceCredential Get Instance credentials by type and username. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId Instance's ID - @return ApiGetInstanceCredentialListRequest + @param type_ Type of credential + @param username Username + @return ApiGetInstanceCredentialRequest */ -func (a *PubliccloudAPIService) GetInstanceCredentialList(ctx context.Context, instanceId string) ApiGetInstanceCredentialListRequest { - return ApiGetInstanceCredentialListRequest{ +func (a *PubliccloudAPIService) GetInstanceCredential(ctx context.Context, instanceId string, type_ CredentialType, username string) ApiGetInstanceCredentialRequest { + return ApiGetInstanceCredentialRequest{ ApiService: a, ctx: ctx, instanceId: instanceId, + type_: type_, + username: username, } } // Execute executes the request -// @return GetCredentialListResult -func (a *PubliccloudAPIService) GetInstanceCredentialListExecute(r ApiGetInstanceCredentialListRequest) (*GetCredentialListResult, *http.Response, error) { +// @return GetCredentialResult +func (a *PubliccloudAPIService) GetInstanceCredentialExecute(r ApiGetInstanceCredentialRequest) (*GetCredentialResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetCredentialResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetInstanceCredential") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/instances/{instanceId}/credentials/{type}/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", url.PathEscape(parameterValueToString(r.type_, "type_")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["X-LSW-Auth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-LSW-Auth"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInstanceCredentialListRequest struct { + ctx context.Context + ApiService PubliccloudAPI + instanceId string +} + +func (r ApiGetInstanceCredentialListRequest) Execute() (*GetCredentialListResult, *http.Response, error) { + return r.ApiService.GetInstanceCredentialListExecute(r) +} + +/* +GetInstanceCredentialList List credentials stored for a specific Instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId Instance's ID + @return ApiGetInstanceCredentialListRequest +*/ +func (a *PubliccloudAPIService) GetInstanceCredentialList(ctx context.Context, instanceId string) ApiGetInstanceCredentialListRequest { + return ApiGetInstanceCredentialListRequest{ + ApiService: a, + ctx: ctx, + instanceId: instanceId, + } +} + +// Execute executes the request +// @return GetCredentialListResult +func (a *PubliccloudAPIService) GetInstanceCredentialListExecute(r ApiGetInstanceCredentialListRequest) (*GetCredentialListResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} @@ -9012,21 +9448,401 @@ func (a *PubliccloudAPIService) GetInstanceList(ctx context.Context) ApiGetInsta } // Execute executes the request -// @return GetInstanceListResult -func (a *PubliccloudAPIService) GetInstanceListExecute(r ApiGetInstanceListRequest) (*GetInstanceListResult, *http.Response, error) { +// @return GetInstanceListResult +func (a *PubliccloudAPIService) GetInstanceListExecute(r ApiGetInstanceListRequest) (*GetInstanceListResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetInstanceListResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetInstanceList") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/instances" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.ip != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ip", r.ip, "form", "") + } + if r.reference != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "reference", r.reference, "form", "") + } + if r.id != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", r.id, "form", "") + } + if r.contractType != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "contractType", r.contractType, "form", "") + } + if r.contractState != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "contractState", r.contractState, "form", "") + } + if r.imageId != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "imageId", r.imageId, "form", "") + } + if r.state != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "state", r.state, "form", "") + } + if r.region != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", r.region, "form", "") + } + if r.type_ != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["X-LSW-Auth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-LSW-Auth"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInstanceSnapshotRequest struct { + ctx context.Context + ApiService PubliccloudAPI + instanceId string + snapshotId string +} + +func (r ApiGetInstanceSnapshotRequest) Execute() (*Snapshot, *http.Response, error) { + return r.ApiService.GetInstanceSnapshotExecute(r) +} + +/* +GetInstanceSnapshot Get snapshot detail + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId Instance's ID + @param snapshotId + @return ApiGetInstanceSnapshotRequest +*/ +func (a *PubliccloudAPIService) GetInstanceSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiGetInstanceSnapshotRequest { + return ApiGetInstanceSnapshotRequest{ + ApiService: a, + ctx: ctx, + instanceId: instanceId, + snapshotId: snapshotId, + } +} + +// Execute executes the request +// @return Snapshot +func (a *PubliccloudAPIService) GetInstanceSnapshotExecute(r ApiGetInstanceSnapshotRequest) (*Snapshot, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetInstanceSnapshot") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/instances/{instanceId}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["X-LSW-Auth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-LSW-Auth"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetInstanceSnapshotListRequest struct { + ctx context.Context + ApiService PubliccloudAPI + instanceId string + limit *int32 + offset *int32 +} + +// Limit the number of results returned. +func (r ApiGetInstanceSnapshotListRequest) Limit(limit int32) ApiGetInstanceSnapshotListRequest { + r.limit = &limit + return r +} + +// Return results starting from the given offset. +func (r ApiGetInstanceSnapshotListRequest) Offset(offset int32) ApiGetInstanceSnapshotListRequest { + r.offset = &offset + return r +} + +func (r ApiGetInstanceSnapshotListRequest) Execute() (*GetSnapshotListResult, *http.Response, error) { + return r.ApiService.GetInstanceSnapshotListExecute(r) +} + +/* +GetInstanceSnapshotList List snapshots + +List instance snapshots + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param instanceId Instance's ID + @return ApiGetInstanceSnapshotListRequest +*/ +func (a *PubliccloudAPIService) GetInstanceSnapshotList(ctx context.Context, instanceId string) ApiGetInstanceSnapshotListRequest { + return ApiGetInstanceSnapshotListRequest{ + ApiService: a, + ctx: ctx, + instanceId: instanceId, + } +} + +// Execute executes the request +// @return GetSnapshotListResult +func (a *PubliccloudAPIService) GetInstanceSnapshotListExecute(r ApiGetInstanceSnapshotListRequest) (*GetSnapshotListResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetInstanceListResult + localVarReturnValue *GetSnapshotListResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetInstanceList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetInstanceSnapshotList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/instances" + localVarPath := localBasePath + "/instances/{instanceId}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -9038,33 +9854,6 @@ func (a *PubliccloudAPIService) GetInstanceListExecute(r ApiGetInstanceListReque if r.offset != nil { parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } - if r.ip != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "ip", r.ip, "form", "") - } - if r.reference != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "reference", r.reference, "form", "") - } - if r.id != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "id", r.id, "form", "") - } - if r.contractType != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "contractType", r.contractType, "form", "") - } - if r.contractState != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "contractState", r.contractState, "form", "") - } - if r.imageId != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "imageId", r.imageId, "form", "") - } - if r.state != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "state", r.state, "form", "") - } - if r.region != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "region", r.region, "form", "") - } - if r.type_ != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "type", r.type_, "form", "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -9140,6 +9929,17 @@ func (a *PubliccloudAPIService) GetInstanceListExecute(r ApiGetInstanceListReque newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -11738,21 +12538,231 @@ func (a *PubliccloudAPIService) GetRequestsMetrics(ctx context.Context, loadBala } // Execute executes the request -// @return GetRequestsMetricsResult -func (a *PubliccloudAPIService) GetRequestsMetricsExecute(r ApiGetRequestsMetricsRequest) (*GetRequestsMetricsResult, *http.Response, error) { +// @return GetRequestsMetricsResult +func (a *PubliccloudAPIService) GetRequestsMetricsExecute(r ApiGetRequestsMetricsRequest) (*GetRequestsMetricsResult, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetRequestsMetricsResult + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetRequestsMetrics") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/requests" + localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.from != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") + } + if r.to != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + } + if r.granularity != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["X-LSW-Auth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-LSW-Auth"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetRequestsPerSecondMetricsRequest struct { + ctx context.Context + ApiService PubliccloudAPI + loadBalancerId string + from *string + to *string + granularity *MetricsGranularity +} + +// The start of the interval to get the metric +func (r ApiGetRequestsPerSecondMetricsRequest) From(from string) ApiGetRequestsPerSecondMetricsRequest { + r.from = &from + return r +} + +// The end of the interval to get the metric. Must be greater than the date provided in `from` +func (r ApiGetRequestsPerSecondMetricsRequest) To(to string) ApiGetRequestsPerSecondMetricsRequest { + r.to = &to + return r +} + +// The interval for each metric +func (r ApiGetRequestsPerSecondMetricsRequest) Granularity(granularity MetricsGranularity) ApiGetRequestsPerSecondMetricsRequest { + r.granularity = &granularity + return r +} + +func (r ApiGetRequestsPerSecondMetricsRequest) Execute() (*GetRequestsPerSecondMetricsResult, *http.Response, error) { + return r.ApiService.GetRequestsPerSecondMetricsExecute(r) +} + +/* +GetRequestsPerSecondMetrics Get load balancer requests per second metrics + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param loadBalancerId Load balancer ID + @return ApiGetRequestsPerSecondMetricsRequest +*/ +func (a *PubliccloudAPIService) GetRequestsPerSecondMetrics(ctx context.Context, loadBalancerId string) ApiGetRequestsPerSecondMetricsRequest { + return ApiGetRequestsPerSecondMetricsRequest{ + ApiService: a, + ctx: ctx, + loadBalancerId: loadBalancerId, + } +} + +// Execute executes the request +// @return GetRequestsPerSecondMetricsResult +func (a *PubliccloudAPIService) GetRequestsPerSecondMetricsExecute(r ApiGetRequestsPerSecondMetricsRequest) (*GetRequestsPerSecondMetricsResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetRequestsMetricsResult + localVarReturnValue *GetRequestsPerSecondMetricsResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetRequestsMetrics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetRequestsPerSecondMetrics") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/requests" + localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/requestsPerSecond" localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) localVarHeaderParams := make(map[string]string) @@ -11901,46 +12911,46 @@ func (a *PubliccloudAPIService) GetRequestsMetricsExecute(r ApiGetRequestsMetric return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetRequestsPerSecondMetricsRequest struct { +type ApiGetResponseCodesMetricsRequest struct { ctx context.Context ApiService PubliccloudAPI loadBalancerId string from *string to *string - granularity *MetricsGranularity + granularity *string } // The start of the interval to get the metric -func (r ApiGetRequestsPerSecondMetricsRequest) From(from string) ApiGetRequestsPerSecondMetricsRequest { +func (r ApiGetResponseCodesMetricsRequest) From(from string) ApiGetResponseCodesMetricsRequest { r.from = &from return r } // The end of the interval to get the metric. Must be greater than the date provided in `from` -func (r ApiGetRequestsPerSecondMetricsRequest) To(to string) ApiGetRequestsPerSecondMetricsRequest { +func (r ApiGetResponseCodesMetricsRequest) To(to string) ApiGetResponseCodesMetricsRequest { r.to = &to return r } // The interval for each metric -func (r ApiGetRequestsPerSecondMetricsRequest) Granularity(granularity MetricsGranularity) ApiGetRequestsPerSecondMetricsRequest { +func (r ApiGetResponseCodesMetricsRequest) Granularity(granularity string) ApiGetResponseCodesMetricsRequest { r.granularity = &granularity return r } -func (r ApiGetRequestsPerSecondMetricsRequest) Execute() (*GetRequestsPerSecondMetricsResult, *http.Response, error) { - return r.ApiService.GetRequestsPerSecondMetricsExecute(r) +func (r ApiGetResponseCodesMetricsRequest) Execute() (*GetResponseCodesMetricsResult, *http.Response, error) { + return r.ApiService.GetResponseCodesMetricsExecute(r) } /* -GetRequestsPerSecondMetrics Get load balancer requests per second metrics +GetResponseCodesMetrics Get response codes metrics @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param loadBalancerId Load balancer ID - @return ApiGetRequestsPerSecondMetricsRequest + @return ApiGetResponseCodesMetricsRequest */ -func (a *PubliccloudAPIService) GetRequestsPerSecondMetrics(ctx context.Context, loadBalancerId string) ApiGetRequestsPerSecondMetricsRequest { - return ApiGetRequestsPerSecondMetricsRequest{ +func (a *PubliccloudAPIService) GetResponseCodesMetrics(ctx context.Context, loadBalancerId string) ApiGetResponseCodesMetricsRequest { + return ApiGetResponseCodesMetricsRequest{ ApiService: a, ctx: ctx, loadBalancerId: loadBalancerId, @@ -11948,21 +12958,21 @@ func (a *PubliccloudAPIService) GetRequestsPerSecondMetrics(ctx context.Context, } // Execute executes the request -// @return GetRequestsPerSecondMetricsResult -func (a *PubliccloudAPIService) GetRequestsPerSecondMetricsExecute(r ApiGetRequestsPerSecondMetricsRequest) (*GetRequestsPerSecondMetricsResult, *http.Response, error) { +// @return GetResponseCodesMetricsResult +func (a *PubliccloudAPIService) GetResponseCodesMetricsExecute(r ApiGetResponseCodesMetricsRequest) (*GetResponseCodesMetricsResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetRequestsPerSecondMetricsResult + localVarReturnValue *GetResponseCodesMetricsResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetRequestsPerSecondMetrics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetResponseCodesMetrics") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/requestsPerSecond" + localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/responseCodes" localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) localVarHeaderParams := make(map[string]string) @@ -12111,7 +13121,7 @@ func (a *PubliccloudAPIService) GetRequestsPerSecondMetricsExecute(r ApiGetReque return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetResponseCodesMetricsRequest struct { +type ApiGetResponseCodesPerSecondMetricsRequest struct { ctx context.Context ApiService PubliccloudAPI loadBalancerId string @@ -12121,36 +13131,36 @@ type ApiGetResponseCodesMetricsRequest struct { } // The start of the interval to get the metric -func (r ApiGetResponseCodesMetricsRequest) From(from string) ApiGetResponseCodesMetricsRequest { +func (r ApiGetResponseCodesPerSecondMetricsRequest) From(from string) ApiGetResponseCodesPerSecondMetricsRequest { r.from = &from return r } // The end of the interval to get the metric. Must be greater than the date provided in `from` -func (r ApiGetResponseCodesMetricsRequest) To(to string) ApiGetResponseCodesMetricsRequest { +func (r ApiGetResponseCodesPerSecondMetricsRequest) To(to string) ApiGetResponseCodesPerSecondMetricsRequest { r.to = &to return r } // The interval for each metric -func (r ApiGetResponseCodesMetricsRequest) Granularity(granularity string) ApiGetResponseCodesMetricsRequest { +func (r ApiGetResponseCodesPerSecondMetricsRequest) Granularity(granularity string) ApiGetResponseCodesPerSecondMetricsRequest { r.granularity = &granularity return r } -func (r ApiGetResponseCodesMetricsRequest) Execute() (*GetResponseCodesMetricsResult, *http.Response, error) { - return r.ApiService.GetResponseCodesMetricsExecute(r) +func (r ApiGetResponseCodesPerSecondMetricsRequest) Execute() (*GetResponseCodesPerSecondMetricsResult, *http.Response, error) { + return r.ApiService.GetResponseCodesPerSecondMetricsExecute(r) } /* -GetResponseCodesMetrics Get response codes metrics +GetResponseCodesPerSecondMetrics Get response codes per second metrics @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param loadBalancerId Load balancer ID - @return ApiGetResponseCodesMetricsRequest + @return ApiGetResponseCodesPerSecondMetricsRequest */ -func (a *PubliccloudAPIService) GetResponseCodesMetrics(ctx context.Context, loadBalancerId string) ApiGetResponseCodesMetricsRequest { - return ApiGetResponseCodesMetricsRequest{ +func (a *PubliccloudAPIService) GetResponseCodesPerSecondMetrics(ctx context.Context, loadBalancerId string) ApiGetResponseCodesPerSecondMetricsRequest { + return ApiGetResponseCodesPerSecondMetricsRequest{ ApiService: a, ctx: ctx, loadBalancerId: loadBalancerId, @@ -12158,21 +13168,21 @@ func (a *PubliccloudAPIService) GetResponseCodesMetrics(ctx context.Context, loa } // Execute executes the request -// @return GetResponseCodesMetricsResult -func (a *PubliccloudAPIService) GetResponseCodesMetricsExecute(r ApiGetResponseCodesMetricsRequest) (*GetResponseCodesMetricsResult, *http.Response, error) { +// @return GetResponseCodesPerSecondMetricsResult +func (a *PubliccloudAPIService) GetResponseCodesPerSecondMetricsExecute(r ApiGetResponseCodesPerSecondMetricsRequest) (*GetResponseCodesPerSecondMetricsResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetResponseCodesMetricsResult + localVarReturnValue *GetResponseCodesPerSecondMetricsResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetResponseCodesMetrics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetResponseCodesPerSecondMetrics") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/responseCodes" + localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/responseCodesPerSecond" localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) localVarHeaderParams := make(map[string]string) @@ -12321,83 +13331,55 @@ func (a *PubliccloudAPIService) GetResponseCodesMetricsExecute(r ApiGetResponseC return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetResponseCodesPerSecondMetricsRequest struct { +type ApiGetTargetGroupRequest struct { ctx context.Context ApiService PubliccloudAPI - loadBalancerId string - from *string - to *string - granularity *string -} - -// The start of the interval to get the metric -func (r ApiGetResponseCodesPerSecondMetricsRequest) From(from string) ApiGetResponseCodesPerSecondMetricsRequest { - r.from = &from - return r -} - -// The end of the interval to get the metric. Must be greater than the date provided in `from` -func (r ApiGetResponseCodesPerSecondMetricsRequest) To(to string) ApiGetResponseCodesPerSecondMetricsRequest { - r.to = &to - return r -} - -// The interval for each metric -func (r ApiGetResponseCodesPerSecondMetricsRequest) Granularity(granularity string) ApiGetResponseCodesPerSecondMetricsRequest { - r.granularity = &granularity - return r + targetGroupId string } -func (r ApiGetResponseCodesPerSecondMetricsRequest) Execute() (*GetResponseCodesPerSecondMetricsResult, *http.Response, error) { - return r.ApiService.GetResponseCodesPerSecondMetricsExecute(r) +func (r ApiGetTargetGroupRequest) Execute() (*TargetGroup, *http.Response, error) { + return r.ApiService.GetTargetGroupExecute(r) } /* -GetResponseCodesPerSecondMetrics Get response codes per second metrics +GetTargetGroup Get Target Group details + +Get Target Group details. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param loadBalancerId Load balancer ID - @return ApiGetResponseCodesPerSecondMetricsRequest + @param targetGroupId Target Group ID + @return ApiGetTargetGroupRequest */ -func (a *PubliccloudAPIService) GetResponseCodesPerSecondMetrics(ctx context.Context, loadBalancerId string) ApiGetResponseCodesPerSecondMetricsRequest { - return ApiGetResponseCodesPerSecondMetricsRequest{ +func (a *PubliccloudAPIService) GetTargetGroup(ctx context.Context, targetGroupId string) ApiGetTargetGroupRequest { + return ApiGetTargetGroupRequest{ ApiService: a, ctx: ctx, - loadBalancerId: loadBalancerId, + targetGroupId: targetGroupId, } } // Execute executes the request -// @return GetResponseCodesPerSecondMetricsResult -func (a *PubliccloudAPIService) GetResponseCodesPerSecondMetricsExecute(r ApiGetResponseCodesPerSecondMetricsRequest) (*GetResponseCodesPerSecondMetricsResult, *http.Response, error) { +// @return TargetGroup +func (a *PubliccloudAPIService) GetTargetGroupExecute(r ApiGetTargetGroupRequest) (*TargetGroup, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetResponseCodesPerSecondMetricsResult + localVarReturnValue *TargetGroup ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetResponseCodesPerSecondMetrics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetTargetGroup") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/loadBalancers/{loadBalancerId}/metrics/responseCodesPerSecond" - localVarPath = strings.Replace(localVarPath, "{"+"loadBalancerId"+"}", url.PathEscape(parameterValueToString(r.loadBalancerId, "loadBalancerId")), -1) + localVarPath := localBasePath + "/targetGroups/{targetGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"targetGroupId"+"}", url.PathEscape(parameterValueToString(r.targetGroupId, "targetGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.from != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") - } - if r.to != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") - } - if r.granularity != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -12531,57 +13513,116 @@ func (a *PubliccloudAPIService) GetResponseCodesPerSecondMetricsExecute(r ApiGet return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetSnapshotRequest struct { +type ApiGetTargetGroupListRequest struct { ctx context.Context ApiService PubliccloudAPI - instanceId string - snapshotId string + limit *int32 + offset *int32 + id *string + name *string + protocol *Protocol + port *int32 + region *RegionName +} + +// Limit the number of results returned. +func (r ApiGetTargetGroupListRequest) Limit(limit int32) ApiGetTargetGroupListRequest { + r.limit = &limit + return r +} + +// Return results starting from the given offset. +func (r ApiGetTargetGroupListRequest) Offset(offset int32) ApiGetTargetGroupListRequest { + r.offset = &offset + return r } -func (r ApiGetSnapshotRequest) Execute() (*Snapshot, *http.Response, error) { - return r.ApiService.GetSnapshotExecute(r) +func (r ApiGetTargetGroupListRequest) Id(id string) ApiGetTargetGroupListRequest { + r.id = &id + return r +} + +func (r ApiGetTargetGroupListRequest) Name(name string) ApiGetTargetGroupListRequest { + r.name = &name + return r +} + +func (r ApiGetTargetGroupListRequest) Protocol(protocol Protocol) ApiGetTargetGroupListRequest { + r.protocol = &protocol + return r +} + +func (r ApiGetTargetGroupListRequest) Port(port int32) ApiGetTargetGroupListRequest { + r.port = &port + return r +} + +func (r ApiGetTargetGroupListRequest) Region(region RegionName) ApiGetTargetGroupListRequest { + r.region = ®ion + return r +} + +func (r ApiGetTargetGroupListRequest) Execute() (*GetTargetGroupListResult, *http.Response, error) { + return r.ApiService.GetTargetGroupListExecute(r) } /* -GetSnapshot Get snapshot detail +GetTargetGroupList Get Target Group list + +List and filter Target Groups @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @param snapshotId - @return ApiGetSnapshotRequest + @return ApiGetTargetGroupListRequest */ -func (a *PubliccloudAPIService) GetSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiGetSnapshotRequest { - return ApiGetSnapshotRequest{ +func (a *PubliccloudAPIService) GetTargetGroupList(ctx context.Context) ApiGetTargetGroupListRequest { + return ApiGetTargetGroupListRequest{ ApiService: a, ctx: ctx, - instanceId: instanceId, - snapshotId: snapshotId, } } // Execute executes the request -// @return Snapshot -func (a *PubliccloudAPIService) GetSnapshotExecute(r ApiGetSnapshotRequest) (*Snapshot, *http.Response, error) { +// @return GetTargetGroupListResult +func (a *PubliccloudAPIService) GetTargetGroupListExecute(r ApiGetTargetGroupListRequest) (*GetTargetGroupListResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Snapshot + localVarReturnValue *GetTargetGroupListResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetSnapshot") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetTargetGroupList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/instances/{instanceId}/snapshots/{snapshotId}" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + localVarPath := localBasePath + "/targetGroups" localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } + if r.id != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "id", r.id, "form", "") + } + if r.name != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") + } + if r.protocol != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "protocol", r.protocol, "form", "") + } + if r.port != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "port", r.port, "form", "") + } + if r.region != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "region", r.region, "form", "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -12635,7 +13676,7 @@ func (a *PubliccloudAPIService) GetSnapshotExecute(r ApiGetSnapshotRequest) (*Sn body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 401 { + if localVarHTTPResponse.StatusCode == 400 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -12646,7 +13687,7 @@ func (a *PubliccloudAPIService) GetSnapshotExecute(r ApiGetSnapshotRequest) (*Sn newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 403 { + if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -12657,7 +13698,7 @@ func (a *PubliccloudAPIService) GetSnapshotExecute(r ApiGetSnapshotRequest) (*Sn newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } - if localVarHTTPResponse.StatusCode == 404 { + if localVarHTTPResponse.StatusCode == 403 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { @@ -12704,64 +13745,64 @@ func (a *PubliccloudAPIService) GetSnapshotExecute(r ApiGetSnapshotRequest) (*Sn return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetSnapshotListRequest struct { +type ApiGetTargetListRequest struct { ctx context.Context ApiService PubliccloudAPI - instanceId string + targetGroupId string limit *int32 offset *int32 } // Limit the number of results returned. -func (r ApiGetSnapshotListRequest) Limit(limit int32) ApiGetSnapshotListRequest { +func (r ApiGetTargetListRequest) Limit(limit int32) ApiGetTargetListRequest { r.limit = &limit return r } // Return results starting from the given offset. -func (r ApiGetSnapshotListRequest) Offset(offset int32) ApiGetSnapshotListRequest { +func (r ApiGetTargetListRequest) Offset(offset int32) ApiGetTargetListRequest { r.offset = &offset return r } -func (r ApiGetSnapshotListRequest) Execute() (*GetSnapshotListResult, *http.Response, error) { - return r.ApiService.GetSnapshotListExecute(r) +func (r ApiGetTargetListRequest) Execute() (*GetTargetListResult, *http.Response, error) { + return r.ApiService.GetTargetListExecute(r) } /* -GetSnapshotList List snapshots +GetTargetList Get Targets -List instance snapshots +Get targets in a Target Group @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @return ApiGetSnapshotListRequest + @param targetGroupId Target Group ID + @return ApiGetTargetListRequest */ -func (a *PubliccloudAPIService) GetSnapshotList(ctx context.Context, instanceId string) ApiGetSnapshotListRequest { - return ApiGetSnapshotListRequest{ +func (a *PubliccloudAPIService) GetTargetList(ctx context.Context, targetGroupId string) ApiGetTargetListRequest { + return ApiGetTargetListRequest{ ApiService: a, ctx: ctx, - instanceId: instanceId, + targetGroupId: targetGroupId, } } // Execute executes the request -// @return GetSnapshotListResult -func (a *PubliccloudAPIService) GetSnapshotListExecute(r ApiGetSnapshotListRequest) (*GetSnapshotListResult, *http.Response, error) { +// @return GetTargetListResult +func (a *PubliccloudAPIService) GetTargetListExecute(r ApiGetTargetListRequest) (*GetTargetListResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetSnapshotListResult + localVarReturnValue *GetTargetListResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetSnapshotList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetTargetList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/instances/{instanceId}/snapshots" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/targetGroups/{targetGroupId}/targets" + localVarPath = strings.Replace(localVarPath, "{"+"targetGroupId"+"}", url.PathEscape(parameterValueToString(r.targetGroupId, "targetGroupId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -12826,6 +13867,17 @@ func (a *PubliccloudAPIService) GetSnapshotListExecute(r ApiGetSnapshotListReque body: localVarBody, error: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -12895,55 +13947,79 @@ func (a *PubliccloudAPIService) GetSnapshotListExecute(r ApiGetSnapshotListReque return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetTargetGroupRequest struct { +type ApiGetUpdateInstanceTypeListRequest struct { ctx context.Context ApiService PubliccloudAPI - targetGroupId string + instanceId string + limit *int32 + offset *int32 } -func (r ApiGetTargetGroupRequest) Execute() (*TargetGroup, *http.Response, error) { - return r.ApiService.GetTargetGroupExecute(r) +func (r ApiGetUpdateInstanceTypeListRequest) Limit(limit int32) ApiGetUpdateInstanceTypeListRequest { + r.limit = &limit + return r +} + +func (r ApiGetUpdateInstanceTypeListRequest) Offset(offset int32) ApiGetUpdateInstanceTypeListRequest { + r.offset = &offset + return r +} + +func (r ApiGetUpdateInstanceTypeListRequest) Execute() (*InstanceTypes, *http.Response, error) { + return r.ApiService.GetUpdateInstanceTypeListExecute(r) } /* -GetTargetGroup Get Target Group details +GetUpdateInstanceTypeList List available instance types for update -Get Target Group details. +Get available instance types for update @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param targetGroupId Target Group ID - @return ApiGetTargetGroupRequest + @param instanceId Instance's ID + @return ApiGetUpdateInstanceTypeListRequest */ -func (a *PubliccloudAPIService) GetTargetGroup(ctx context.Context, targetGroupId string) ApiGetTargetGroupRequest { - return ApiGetTargetGroupRequest{ +func (a *PubliccloudAPIService) GetUpdateInstanceTypeList(ctx context.Context, instanceId string) ApiGetUpdateInstanceTypeListRequest { + return ApiGetUpdateInstanceTypeListRequest{ ApiService: a, ctx: ctx, - targetGroupId: targetGroupId, + instanceId: instanceId, } } // Execute executes the request -// @return TargetGroup -func (a *PubliccloudAPIService) GetTargetGroupExecute(r ApiGetTargetGroupRequest) (*TargetGroup, *http.Response, error) { +// @return InstanceTypes +func (a *PubliccloudAPIService) GetUpdateInstanceTypeListExecute(r ApiGetUpdateInstanceTypeListRequest) (*InstanceTypes, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *TargetGroup + localVarReturnValue *InstanceTypes ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetTargetGroup") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetUpdateInstanceTypeList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/targetGroups/{targetGroupId}" - localVarPath = strings.Replace(localVarPath, "{"+"targetGroupId"+"}", url.PathEscape(parameterValueToString(r.targetGroupId, "targetGroupId")), -1) + localVarPath := localBasePath + "/instances/{instanceId}/instanceTypesUpdate" + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") + } else { + var defaultValue int32 = 50 + r.limit = &defaultValue + } + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") + } else { + var defaultValue int32 = 0 + r.offset = &defaultValue + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -12997,17 +14073,6 @@ func (a *PubliccloudAPIService) GetTargetGroupExecute(r ApiGetTargetGroupRequest body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResult - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -13077,116 +14142,55 @@ func (a *PubliccloudAPIService) GetTargetGroupExecute(r ApiGetTargetGroupRequest return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetTargetGroupListRequest struct { +type ApiGetVPSConsoleAccessRequest struct { ctx context.Context ApiService PubliccloudAPI - limit *int32 - offset *int32 - id *string - name *string - protocol *Protocol - port *int32 - region *RegionName -} - -// Limit the number of results returned. -func (r ApiGetTargetGroupListRequest) Limit(limit int32) ApiGetTargetGroupListRequest { - r.limit = &limit - return r -} - -// Return results starting from the given offset. -func (r ApiGetTargetGroupListRequest) Offset(offset int32) ApiGetTargetGroupListRequest { - r.offset = &offset - return r -} - -func (r ApiGetTargetGroupListRequest) Id(id string) ApiGetTargetGroupListRequest { - r.id = &id - return r -} - -func (r ApiGetTargetGroupListRequest) Name(name string) ApiGetTargetGroupListRequest { - r.name = &name - return r -} - -func (r ApiGetTargetGroupListRequest) Protocol(protocol Protocol) ApiGetTargetGroupListRequest { - r.protocol = &protocol - return r -} - -func (r ApiGetTargetGroupListRequest) Port(port int32) ApiGetTargetGroupListRequest { - r.port = &port - return r -} - -func (r ApiGetTargetGroupListRequest) Region(region RegionName) ApiGetTargetGroupListRequest { - r.region = ®ion - return r + vpsId string } -func (r ApiGetTargetGroupListRequest) Execute() (*GetTargetGroupListResult, *http.Response, error) { - return r.ApiService.GetTargetGroupListExecute(r) +func (r ApiGetVPSConsoleAccessRequest) Execute() (*GetConsoleAccessResult, *http.Response, error) { + return r.ApiService.GetVPSConsoleAccessExecute(r) } /* -GetTargetGroupList Get Target Group list +GetVPSConsoleAccess Get console access -List and filter Target Groups +Get console access to the VPS @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiGetTargetGroupListRequest + @param vpsId VPS ID + @return ApiGetVPSConsoleAccessRequest */ -func (a *PubliccloudAPIService) GetTargetGroupList(ctx context.Context) ApiGetTargetGroupListRequest { - return ApiGetTargetGroupListRequest{ +func (a *PubliccloudAPIService) GetVPSConsoleAccess(ctx context.Context, vpsId string) ApiGetVPSConsoleAccessRequest { + return ApiGetVPSConsoleAccessRequest{ ApiService: a, ctx: ctx, + vpsId: vpsId, } } // Execute executes the request -// @return GetTargetGroupListResult -func (a *PubliccloudAPIService) GetTargetGroupListExecute(r ApiGetTargetGroupListRequest) (*GetTargetGroupListResult, *http.Response, error) { +// @return GetConsoleAccessResult +func (a *PubliccloudAPIService) GetVPSConsoleAccessExecute(r ApiGetVPSConsoleAccessRequest) (*GetConsoleAccessResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetTargetGroupListResult + localVarReturnValue *GetConsoleAccessResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetTargetGroupList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSConsoleAccess") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/targetGroups" + localVarPath := localBasePath + "/vps/{vpsId}/console" + localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } - if r.id != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "id", r.id, "form", "") - } - if r.name != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "name", r.name, "form", "") - } - if r.protocol != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "protocol", r.protocol, "form", "") - } - if r.port != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "port", r.port, "form", "") - } - if r.region != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "region", r.region, "form", "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -13273,6 +14277,17 @@ func (a *PubliccloudAPIService) GetTargetGroupListExecute(r ApiGetTargetGroupLis newErr.model = v return localVarReturnValue, localVarHTTPResponse, newErr } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 500 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -13309,75 +14324,61 @@ func (a *PubliccloudAPIService) GetTargetGroupListExecute(r ApiGetTargetGroupLis return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetTargetListRequest struct { +type ApiGetVPSCredentialRequest struct { ctx context.Context ApiService PubliccloudAPI - targetGroupId string - limit *int32 - offset *int32 -} - -// Limit the number of results returned. -func (r ApiGetTargetListRequest) Limit(limit int32) ApiGetTargetListRequest { - r.limit = &limit - return r -} - -// Return results starting from the given offset. -func (r ApiGetTargetListRequest) Offset(offset int32) ApiGetTargetListRequest { - r.offset = &offset - return r + vpsId string + type_ CredentialType + username string } -func (r ApiGetTargetListRequest) Execute() (*GetTargetListResult, *http.Response, error) { - return r.ApiService.GetTargetListExecute(r) +func (r ApiGetVPSCredentialRequest) Execute() (*GetCredentialResult, *http.Response, error) { + return r.ApiService.GetVPSCredentialExecute(r) } /* -GetTargetList Get Targets - -Get targets in a Target Group +GetVPSCredential Get VPS credential by type and username. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param targetGroupId Target Group ID - @return ApiGetTargetListRequest + @param vpsId VPS ID + @param type_ Type of credential + @param username Username + @return ApiGetVPSCredentialRequest */ -func (a *PubliccloudAPIService) GetTargetList(ctx context.Context, targetGroupId string) ApiGetTargetListRequest { - return ApiGetTargetListRequest{ +func (a *PubliccloudAPIService) GetVPSCredential(ctx context.Context, vpsId string, type_ CredentialType, username string) ApiGetVPSCredentialRequest { + return ApiGetVPSCredentialRequest{ ApiService: a, ctx: ctx, - targetGroupId: targetGroupId, + vpsId: vpsId, + type_: type_, + username: username, } } // Execute executes the request -// @return GetTargetListResult -func (a *PubliccloudAPIService) GetTargetListExecute(r ApiGetTargetListRequest) (*GetTargetListResult, *http.Response, error) { +// @return GetCredentialResult +func (a *PubliccloudAPIService) GetVPSCredentialExecute(r ApiGetVPSCredentialRequest) (*GetCredentialResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetTargetListResult + localVarReturnValue *GetCredentialResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetTargetList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSCredential") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/targetGroups/{targetGroupId}/targets" - localVarPath = strings.Replace(localVarPath, "{"+"targetGroupId"+"}", url.PathEscape(parameterValueToString(r.targetGroupId, "targetGroupId")), -1) + localVarPath := localBasePath + "/vps/{vpsId}/credentials/{type}/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", url.PathEscape(parameterValueToString(r.type_, "type_")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -13511,79 +14512,53 @@ func (a *PubliccloudAPIService) GetTargetListExecute(r ApiGetTargetListRequest) return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetUpdateInstanceTypeListRequest struct { - ctx context.Context - ApiService PubliccloudAPI - instanceId string - limit *int32 - offset *int32 -} - -func (r ApiGetUpdateInstanceTypeListRequest) Limit(limit int32) ApiGetUpdateInstanceTypeListRequest { - r.limit = &limit - return r -} - -func (r ApiGetUpdateInstanceTypeListRequest) Offset(offset int32) ApiGetUpdateInstanceTypeListRequest { - r.offset = &offset - return r +type ApiGetVPSCredentialListRequest struct { + ctx context.Context + ApiService PubliccloudAPI + vpsId string } -func (r ApiGetUpdateInstanceTypeListRequest) Execute() (*InstanceTypes, *http.Response, error) { - return r.ApiService.GetUpdateInstanceTypeListExecute(r) +func (r ApiGetVPSCredentialListRequest) Execute() (*GetCredentialListResult, *http.Response, error) { + return r.ApiService.GetVPSCredentialListExecute(r) } /* -GetUpdateInstanceTypeList List available instance types for update - -Get available instance types for update +GetVPSCredentialList List credentials stored for a specific VPS @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param instanceId Instance's ID - @return ApiGetUpdateInstanceTypeListRequest + @param vpsId VPS ID + @return ApiGetVPSCredentialListRequest */ -func (a *PubliccloudAPIService) GetUpdateInstanceTypeList(ctx context.Context, instanceId string) ApiGetUpdateInstanceTypeListRequest { - return ApiGetUpdateInstanceTypeListRequest{ +func (a *PubliccloudAPIService) GetVPSCredentialList(ctx context.Context, vpsId string) ApiGetVPSCredentialListRequest { + return ApiGetVPSCredentialListRequest{ ApiService: a, ctx: ctx, - instanceId: instanceId, + vpsId: vpsId, } } // Execute executes the request -// @return InstanceTypes -func (a *PubliccloudAPIService) GetUpdateInstanceTypeListExecute(r ApiGetUpdateInstanceTypeListRequest) (*InstanceTypes, *http.Response, error) { +// @return GetCredentialListResult +func (a *PubliccloudAPIService) GetVPSCredentialListExecute(r ApiGetVPSCredentialListRequest) (*GetCredentialListResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *InstanceTypes + localVarReturnValue *GetCredentialListResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetUpdateInstanceTypeList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSCredentialList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/instances/{instanceId}/instanceTypesUpdate" - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath := localBasePath + "/vps/{vpsId}/credentials" + localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.limit != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") - } else { - var defaultValue int32 = 50 - r.limit = &defaultValue - } - if r.offset != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") - } else { - var defaultValue int32 = 0 - r.offset = &defaultValue - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -13706,56 +14681,52 @@ func (a *PubliccloudAPIService) GetUpdateInstanceTypeListExecute(r ApiGetUpdateI return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetVPSCredentialRequest struct { +type ApiGetVPSCredentialListByTypeRequest struct { ctx context.Context ApiService PubliccloudAPI vpsId string type_ CredentialType - username string } -func (r ApiGetVPSCredentialRequest) Execute() (*GetCredentialResult, *http.Response, error) { - return r.ApiService.GetVPSCredentialExecute(r) +func (r ApiGetVPSCredentialListByTypeRequest) Execute() (*GetCredentialListByTypeResult, *http.Response, error) { + return r.ApiService.GetVPSCredentialListByTypeExecute(r) } /* -GetVPSCredential Get VPS credential by type and username. +GetVPSCredentialListByType Get credentials by type for a specific VPS @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vpsId VPS ID @param type_ Type of credential - @param username Username - @return ApiGetVPSCredentialRequest + @return ApiGetVPSCredentialListByTypeRequest */ -func (a *PubliccloudAPIService) GetVPSCredential(ctx context.Context, vpsId string, type_ CredentialType, username string) ApiGetVPSCredentialRequest { - return ApiGetVPSCredentialRequest{ +func (a *PubliccloudAPIService) GetVPSCredentialListByType(ctx context.Context, vpsId string, type_ CredentialType) ApiGetVPSCredentialListByTypeRequest { + return ApiGetVPSCredentialListByTypeRequest{ ApiService: a, ctx: ctx, vpsId: vpsId, type_: type_, - username: username, } } // Execute executes the request -// @return GetCredentialResult -func (a *PubliccloudAPIService) GetVPSCredentialExecute(r ApiGetVPSCredentialRequest) (*GetCredentialResult, *http.Response, error) { +// @return GetCredentialListByTypeResult +func (a *PubliccloudAPIService) GetVPSCredentialListByTypeExecute(r ApiGetVPSCredentialListByTypeRequest) (*GetCredentialListByTypeResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetCredentialResult + localVarReturnValue *GetCredentialListByTypeResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSCredential") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSCredentialListByType") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/vps/{vpsId}/credentials/{type}/{username}" + localVarPath := localBasePath + "/vps/{vpsId}/credentials/{type}" localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", url.PathEscape(parameterValueToString(r.type_, "type_")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -13894,25 +14865,53 @@ func (a *PubliccloudAPIService) GetVPSCredentialExecute(r ApiGetVPSCredentialReq return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetVPSCredentialListRequest struct { +type ApiGetVPSDataTrafficMetricsRequest struct { ctx context.Context ApiService PubliccloudAPI vpsId string + from *string + to *string + granularity *string + aggregation *string } -func (r ApiGetVPSCredentialListRequest) Execute() (*GetCredentialListResult, *http.Response, error) { - return r.ApiService.GetVPSCredentialListExecute(r) +// The start of the interval to get the metric +func (r ApiGetVPSDataTrafficMetricsRequest) From(from string) ApiGetVPSDataTrafficMetricsRequest { + r.from = &from + return r +} + +// The end of the interval to get the metric. Must be greater than the date provided in `from` +func (r ApiGetVPSDataTrafficMetricsRequest) To(to string) ApiGetVPSDataTrafficMetricsRequest { + r.to = &to + return r +} + +// How the metrics are grouped by +func (r ApiGetVPSDataTrafficMetricsRequest) Granularity(granularity string) ApiGetVPSDataTrafficMetricsRequest { + r.granularity = &granularity + return r +} + +// How the metrics are aggregated +func (r ApiGetVPSDataTrafficMetricsRequest) Aggregation(aggregation string) ApiGetVPSDataTrafficMetricsRequest { + r.aggregation = &aggregation + return r +} + +func (r ApiGetVPSDataTrafficMetricsRequest) Execute() (*GetDataTrafficMetricsResult, *http.Response, error) { + return r.ApiService.GetVPSDataTrafficMetricsExecute(r) } /* -GetVPSCredentialList List credentials stored for a specific VPS +GetVPSDataTrafficMetrics Get data traffic metrics for a specific VPS @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vpsId VPS ID - @return ApiGetVPSCredentialListRequest + @return ApiGetVPSDataTrafficMetricsRequest */ -func (a *PubliccloudAPIService) GetVPSCredentialList(ctx context.Context, vpsId string) ApiGetVPSCredentialListRequest { - return ApiGetVPSCredentialListRequest{ +func (a *PubliccloudAPIService) GetVPSDataTrafficMetrics(ctx context.Context, vpsId string) ApiGetVPSDataTrafficMetricsRequest { + return ApiGetVPSDataTrafficMetricsRequest{ ApiService: a, ctx: ctx, vpsId: vpsId, @@ -13920,27 +14919,39 @@ func (a *PubliccloudAPIService) GetVPSCredentialList(ctx context.Context, vpsId } // Execute executes the request -// @return GetCredentialListResult -func (a *PubliccloudAPIService) GetVPSCredentialListExecute(r ApiGetVPSCredentialListRequest) (*GetCredentialListResult, *http.Response, error) { +// @return GetDataTrafficMetricsResult +func (a *PubliccloudAPIService) GetVPSDataTrafficMetricsExecute(r ApiGetVPSDataTrafficMetricsRequest) (*GetDataTrafficMetricsResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetCredentialListResult + localVarReturnValue *GetDataTrafficMetricsResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSCredentialList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSDataTrafficMetrics") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/vps/{vpsId}/credentials" + localVarPath := localBasePath + "/vps/{vpsId}/metrics/datatraffic" localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} + if r.from != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") + } + if r.to != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + } + if r.granularity != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") + } + if r.aggregation != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "aggregation", r.aggregation, "form", "") + } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -13994,6 +15005,17 @@ func (a *PubliccloudAPIService) GetVPSCredentialListExecute(r ApiGetVPSCredentia body: localVarBody, error: localVarHTTPResponse.Status, } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -14063,52 +15085,52 @@ func (a *PubliccloudAPIService) GetVPSCredentialListExecute(r ApiGetVPSCredentia return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetVPSCredentialListByTypeRequest struct { +type ApiGetVPSIPRequest struct { ctx context.Context ApiService PubliccloudAPI vpsId string - type_ CredentialType + ip string } -func (r ApiGetVPSCredentialListByTypeRequest) Execute() (*GetCredentialListByTypeResult, *http.Response, error) { - return r.ApiService.GetVPSCredentialListByTypeExecute(r) +func (r ApiGetVPSIPRequest) Execute() (*IpDetails, *http.Response, error) { + return r.ApiService.GetVPSIPExecute(r) } /* -GetVPSCredentialListByType Get credentials by type for a specific VPS +GetVPSIP Get IP details for a specific VPS @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vpsId VPS ID - @param type_ Type of credential - @return ApiGetVPSCredentialListByTypeRequest + @param ip + @return ApiGetVPSIPRequest */ -func (a *PubliccloudAPIService) GetVPSCredentialListByType(ctx context.Context, vpsId string, type_ CredentialType) ApiGetVPSCredentialListByTypeRequest { - return ApiGetVPSCredentialListByTypeRequest{ +func (a *PubliccloudAPIService) GetVPSIP(ctx context.Context, vpsId string, ip string) ApiGetVPSIPRequest { + return ApiGetVPSIPRequest{ ApiService: a, ctx: ctx, vpsId: vpsId, - type_: type_, + ip: ip, } } // Execute executes the request -// @return GetCredentialListByTypeResult -func (a *PubliccloudAPIService) GetVPSCredentialListByTypeExecute(r ApiGetVPSCredentialListByTypeRequest) (*GetCredentialListByTypeResult, *http.Response, error) { +// @return IpDetails +func (a *PubliccloudAPIService) GetVPSIPExecute(r ApiGetVPSIPRequest) (*IpDetails, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetCredentialListByTypeResult + localVarReturnValue *IpDetails ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSCredentialListByType") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSIP") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/vps/{vpsId}/credentials/{type}" + localVarPath := localBasePath + "/vps/{vpsId}/ips/{ip}" localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"type"+"}", url.PathEscape(parameterValueToString(r.type_, "type_")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"ip"+"}", url.PathEscape(parameterValueToString(r.ip, "ip")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -14167,17 +15189,6 @@ func (a *PubliccloudAPIService) GetVPSCredentialListByTypeExecute(r ApiGetVPSCre body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResult - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -14247,53 +15258,46 @@ func (a *PubliccloudAPIService) GetVPSCredentialListByTypeExecute(r ApiGetVPSCre return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetVPSDataTrafficMetricsRequest struct { +type ApiGetVPSIPListRequest struct { ctx context.Context ApiService PubliccloudAPI vpsId string - from *string - to *string - granularity *string - aggregation *string -} - -// The start of the interval to get the metric -func (r ApiGetVPSDataTrafficMetricsRequest) From(from string) ApiGetVPSDataTrafficMetricsRequest { - r.from = &from - return r + version *IpVersion + nullRouted *bool + ips *string } -// The end of the interval to get the metric. Must be greater than the date provided in `from` -func (r ApiGetVPSDataTrafficMetricsRequest) To(to string) ApiGetVPSDataTrafficMetricsRequest { - r.to = &to +func (r ApiGetVPSIPListRequest) Version(version IpVersion) ApiGetVPSIPListRequest { + r.version = &version return r } -// How the metrics are grouped by -func (r ApiGetVPSDataTrafficMetricsRequest) Granularity(granularity string) ApiGetVPSDataTrafficMetricsRequest { - r.granularity = &granularity +func (r ApiGetVPSIPListRequest) NullRouted(nullRouted bool) ApiGetVPSIPListRequest { + r.nullRouted = &nullRouted return r } -// How the metrics are aggregated -func (r ApiGetVPSDataTrafficMetricsRequest) Aggregation(aggregation string) ApiGetVPSDataTrafficMetricsRequest { - r.aggregation = &aggregation +// A list of IPs separated by `|` +func (r ApiGetVPSIPListRequest) Ips(ips string) ApiGetVPSIPListRequest { + r.ips = &ips return r } -func (r ApiGetVPSDataTrafficMetricsRequest) Execute() (*GetDataTrafficMetricsResult, *http.Response, error) { - return r.ApiService.GetVPSDataTrafficMetricsExecute(r) +func (r ApiGetVPSIPListRequest) Execute() (*GetIPListResult, *http.Response, error) { + return r.ApiService.GetVPSIPListExecute(r) } /* -GetVPSDataTrafficMetrics Get data traffic metrics for a specific VPS +GetVPSIPList List IP addresses associated with a specific VPS + +List the VPS's IPs @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vpsId VPS ID - @return ApiGetVPSDataTrafficMetricsRequest + @return ApiGetVPSIPListRequest */ -func (a *PubliccloudAPIService) GetVPSDataTrafficMetrics(ctx context.Context, vpsId string) ApiGetVPSDataTrafficMetricsRequest { - return ApiGetVPSDataTrafficMetricsRequest{ +func (a *PubliccloudAPIService) GetVPSIPList(ctx context.Context, vpsId string) ApiGetVPSIPListRequest { + return ApiGetVPSIPListRequest{ ApiService: a, ctx: ctx, vpsId: vpsId, @@ -14301,38 +15305,35 @@ func (a *PubliccloudAPIService) GetVPSDataTrafficMetrics(ctx context.Context, vp } // Execute executes the request -// @return GetDataTrafficMetricsResult -func (a *PubliccloudAPIService) GetVPSDataTrafficMetricsExecute(r ApiGetVPSDataTrafficMetricsRequest) (*GetDataTrafficMetricsResult, *http.Response, error) { +// @return GetIPListResult +func (a *PubliccloudAPIService) GetVPSIPListExecute(r ApiGetVPSIPListRequest) (*GetIPListResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetDataTrafficMetricsResult + localVarReturnValue *GetIPListResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSDataTrafficMetrics") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSIPList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/vps/{vpsId}/metrics/datatraffic" + localVarPath := localBasePath + "/vps/{vpsId}/ips" localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.from != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "from", r.from, "form", "") - } - if r.to != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "to", r.to, "form", "") + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.version != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "version", r.version, "form", "") } - if r.granularity != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "granularity", r.granularity, "form", "") + if r.nullRouted != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "nullRouted", r.nullRouted, "form", "") } - if r.aggregation != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "aggregation", r.aggregation, "form", "") + if r.ips != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "ips", r.ips, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -14387,17 +15388,6 @@ func (a *PubliccloudAPIService) GetVPSDataTrafficMetricsExecute(r ApiGetVPSDataT body: localVarBody, error: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v ErrorResult - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } if localVarHTTPResponse.StatusCode == 401 { var v ErrorResult err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -14467,52 +15457,52 @@ func (a *PubliccloudAPIService) GetVPSDataTrafficMetricsExecute(r ApiGetVPSDataT return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetVPSIPRequest struct { +type ApiGetVPSSnapshotRequest struct { ctx context.Context ApiService PubliccloudAPI vpsId string - ip string + snapshotId string } -func (r ApiGetVPSIPRequest) Execute() (*IpDetails, *http.Response, error) { - return r.ApiService.GetVPSIPExecute(r) +func (r ApiGetVPSSnapshotRequest) Execute() (*Snapshot, *http.Response, error) { + return r.ApiService.GetVPSSnapshotExecute(r) } /* -GetVPSIP Get IP details for a specific VPS +GetVPSSnapshot Get snapshot detail @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vpsId VPS ID - @param ip - @return ApiGetVPSIPRequest + @param snapshotId + @return ApiGetVPSSnapshotRequest */ -func (a *PubliccloudAPIService) GetVPSIP(ctx context.Context, vpsId string, ip string) ApiGetVPSIPRequest { - return ApiGetVPSIPRequest{ +func (a *PubliccloudAPIService) GetVPSSnapshot(ctx context.Context, vpsId string, snapshotId string) ApiGetVPSSnapshotRequest { + return ApiGetVPSSnapshotRequest{ ApiService: a, ctx: ctx, vpsId: vpsId, - ip: ip, + snapshotId: snapshotId, } } // Execute executes the request -// @return IpDetails -func (a *PubliccloudAPIService) GetVPSIPExecute(r ApiGetVPSIPRequest) (*IpDetails, *http.Response, error) { +// @return Snapshot +func (a *PubliccloudAPIService) GetVPSSnapshotExecute(r ApiGetVPSSnapshotRequest) (*Snapshot, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *IpDetails + localVarReturnValue *Snapshot ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSIP") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSSnapshot") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/vps/{vpsId}/ips/{ip}" + localVarPath := localBasePath + "/vps/{vpsId}/snapshots/{snapshotId}" localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"ip"+"}", url.PathEscape(parameterValueToString(r.ip, "ip")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -14640,46 +15630,41 @@ func (a *PubliccloudAPIService) GetVPSIPExecute(r ApiGetVPSIPRequest) (*IpDetail return localVarReturnValue, localVarHTTPResponse, nil } -type ApiGetVPSIPListRequest struct { +type ApiGetVPSSnapshotListRequest struct { ctx context.Context ApiService PubliccloudAPI vpsId string - version *IpVersion - nullRouted *bool - ips *string -} - -func (r ApiGetVPSIPListRequest) Version(version IpVersion) ApiGetVPSIPListRequest { - r.version = &version - return r + limit *int32 + offset *int32 } -func (r ApiGetVPSIPListRequest) NullRouted(nullRouted bool) ApiGetVPSIPListRequest { - r.nullRouted = &nullRouted +// Limit the number of results returned. +func (r ApiGetVPSSnapshotListRequest) Limit(limit int32) ApiGetVPSSnapshotListRequest { + r.limit = &limit return r } -// A list of IPs separated by `|` -func (r ApiGetVPSIPListRequest) Ips(ips string) ApiGetVPSIPListRequest { - r.ips = &ips +// Return results starting from the given offset. +func (r ApiGetVPSSnapshotListRequest) Offset(offset int32) ApiGetVPSSnapshotListRequest { + r.offset = &offset return r } -func (r ApiGetVPSIPListRequest) Execute() (*GetIPListResult, *http.Response, error) { - return r.ApiService.GetVPSIPListExecute(r) +func (r ApiGetVPSSnapshotListRequest) Execute() (*GetSnapshotListResult, *http.Response, error) { + return r.ApiService.GetVPSSnapshotListExecute(r) } /* -GetVPSIPList List IP addresses associated with a specific VPS +GetVPSSnapshotList List snapshots -List the VPS's IPs +List VPS snapshots @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param vpsId VPS ID - @return ApiGetVPSIPListRequest + @return ApiGetVPSSnapshotListRequest */ -func (a *PubliccloudAPIService) GetVPSIPList(ctx context.Context, vpsId string) ApiGetVPSIPListRequest { - return ApiGetVPSIPListRequest{ +func (a *PubliccloudAPIService) GetVPSSnapshotList(ctx context.Context, vpsId string) ApiGetVPSSnapshotListRequest { + return ApiGetVPSSnapshotListRequest{ ApiService: a, ctx: ctx, vpsId: vpsId, @@ -14687,35 +15672,32 @@ func (a *PubliccloudAPIService) GetVPSIPList(ctx context.Context, vpsId string) } // Execute executes the request -// @return GetIPListResult -func (a *PubliccloudAPIService) GetVPSIPListExecute(r ApiGetVPSIPListRequest) (*GetIPListResult, *http.Response, error) { +// @return GetSnapshotListResult +func (a *PubliccloudAPIService) GetVPSSnapshotListExecute(r ApiGetVPSSnapshotListRequest) (*GetSnapshotListResult, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetIPListResult + localVarReturnValue *GetSnapshotListResult ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSIPList") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.GetVPSSnapshotList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } - localVarPath := localBasePath + "/vps/{vpsId}/ips" + localVarPath := localBasePath + "/vps/{vpsId}/snapshots" localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} localVarFormParams := url.Values{} - if r.version != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "version", r.version, "form", "") - } - if r.nullRouted != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "nullRouted", r.nullRouted, "form", "") + if r.limit != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "limit", r.limit, "form", "") } - if r.ips != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "ips", r.ips, "form", "") + if r.offset != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "offset", r.offset, "form", "") } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -14855,7 +15837,7 @@ GetVps Get VPS details Get VPS details. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param vpsId Vps ID + @param vpsId VPS ID @return ApiGetVpsRequest */ func (a *PubliccloudAPIService) GetVps(ctx context.Context, vpsId string) ApiGetVpsRequest { @@ -15034,7 +16016,7 @@ func (r ApiGetVpsListRequest) Offset(offset int32) ApiGetVpsListRequest { return r } -// Equipment Id +// VPS Equipment Id func (r ApiGetVpsListRequest) Id(id string) ApiGetVpsListRequest { r.id = &id return r @@ -18549,27 +19531,27 @@ func (a *PubliccloudAPIService) ResetVPSPasswordExecute(r ApiResetVPSPasswordReq return localVarHTTPResponse, nil } -type ApiRestoreSnapshotRequest struct { +type ApiRestoreInstanceSnapshotRequest struct { ctx context.Context ApiService PubliccloudAPI instanceId string snapshotId string } -func (r ApiRestoreSnapshotRequest) Execute() (*http.Response, error) { - return r.ApiService.RestoreSnapshotExecute(r) +func (r ApiRestoreInstanceSnapshotRequest) Execute() (*http.Response, error) { + return r.ApiService.RestoreInstanceSnapshotExecute(r) } /* -RestoreSnapshot Restore instance snapshot +RestoreInstanceSnapshot Restore instance snapshot @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param instanceId Instance's ID @param snapshotId - @return ApiRestoreSnapshotRequest + @return ApiRestoreInstanceSnapshotRequest */ -func (a *PubliccloudAPIService) RestoreSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiRestoreSnapshotRequest { - return ApiRestoreSnapshotRequest{ +func (a *PubliccloudAPIService) RestoreInstanceSnapshot(ctx context.Context, instanceId string, snapshotId string) ApiRestoreInstanceSnapshotRequest { + return ApiRestoreInstanceSnapshotRequest{ ApiService: a, ctx: ctx, instanceId: instanceId, @@ -18578,14 +19560,14 @@ func (a *PubliccloudAPIService) RestoreSnapshot(ctx context.Context, instanceId } // Execute executes the request -func (a *PubliccloudAPIService) RestoreSnapshotExecute(r ApiRestoreSnapshotRequest) (*http.Response, error) { +func (a *PubliccloudAPIService) RestoreInstanceSnapshotExecute(r ApiRestoreInstanceSnapshotRequest) (*http.Response, error) { var ( localVarHTTPMethod = http.MethodPut localVarPostBody interface{} formFiles []formFile ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.RestoreSnapshot") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.RestoreInstanceSnapshot") if err != nil { return nil, &GenericOpenAPIError{error: err.Error()} } @@ -18722,6 +19704,179 @@ func (a *PubliccloudAPIService) RestoreSnapshotExecute(r ApiRestoreSnapshotReque return localVarHTTPResponse, nil } +type ApiRestoreVPSSnapshotRequest struct { + ctx context.Context + ApiService PubliccloudAPI + vpsId string + snapshotId string +} + +func (r ApiRestoreVPSSnapshotRequest) Execute() (*http.Response, error) { + return r.ApiService.RestoreVPSSnapshotExecute(r) +} + +/* +RestoreVPSSnapshot Restore VPS snapshot + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param vpsId VPS ID + @param snapshotId + @return ApiRestoreVPSSnapshotRequest +*/ +func (a *PubliccloudAPIService) RestoreVPSSnapshot(ctx context.Context, vpsId string, snapshotId string) ApiRestoreVPSSnapshotRequest { + return ApiRestoreVPSSnapshotRequest{ + ApiService: a, + ctx: ctx, + vpsId: vpsId, + snapshotId: snapshotId, + } +} + +// Execute executes the request +func (a *PubliccloudAPIService) RestoreVPSSnapshotExecute(r ApiRestoreVPSSnapshotRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "PubliccloudAPIService.RestoreVPSSnapshot") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/vps/{vpsId}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"vpsId"+"}", url.PathEscape(parameterValueToString(r.vpsId, "vpsId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["X-LSW-Auth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-LSW-Auth"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 503 { + var v ErrorResult + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + type ApiStartInstanceRequest struct { ctx context.Context ApiService PubliccloudAPI @@ -19075,7 +20230,7 @@ func (r ApiStartVPSRequest) Execute() (*http.Response, error) { } /* -StartVPS Start a specific resource VPS +StartVPS Start a specific VPS The VPS must be stopped before the execution diff --git a/publiccloud/docs/DataTraffic.md b/publiccloud/docs/DataTraffic.md new file mode 100644 index 0000000..8f41b97 --- /dev/null +++ b/publiccloud/docs/DataTraffic.md @@ -0,0 +1,82 @@ +# DataTraffic + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Value** | Pointer to **float32** | | [optional] +**Unit** | Pointer to **string** | | [optional] + +## Methods + +### NewDataTraffic + +`func NewDataTraffic() *DataTraffic` + +NewDataTraffic instantiates a new DataTraffic object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDataTrafficWithDefaults + +`func NewDataTrafficWithDefaults() *DataTraffic` + +NewDataTrafficWithDefaults instantiates a new DataTraffic object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetValue + +`func (o *DataTraffic) GetValue() float32` + +GetValue returns the Value field if non-nil, zero value otherwise. + +### GetValueOk + +`func (o *DataTraffic) GetValueOk() (*float32, bool)` + +GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetValue + +`func (o *DataTraffic) SetValue(v float32)` + +SetValue sets Value field to given value. + +### HasValue + +`func (o *DataTraffic) HasValue() bool` + +HasValue returns a boolean if a field has been set. + +### GetUnit + +`func (o *DataTraffic) GetUnit() string` + +GetUnit returns the Unit field if non-nil, zero value otherwise. + +### GetUnitOk + +`func (o *DataTraffic) GetUnitOk() (*string, bool)` + +GetUnitOk returns a tuple with the Unit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUnit + +`func (o *DataTraffic) SetUnit(v string)` + +SetUnit sets Unit field to given value. + +### HasUnit + +`func (o *DataTraffic) HasUnit() bool` + +HasUnit returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/publiccloud/docs/GetConsoleAccessToInstanceResult.md b/publiccloud/docs/GetConsoleAccessResult.md similarity index 58% rename from publiccloud/docs/GetConsoleAccessToInstanceResult.md rename to publiccloud/docs/GetConsoleAccessResult.md index c588ee1..b3e0e64 100644 --- a/publiccloud/docs/GetConsoleAccessToInstanceResult.md +++ b/publiccloud/docs/GetConsoleAccessResult.md @@ -1,4 +1,4 @@ -# GetConsoleAccessToInstanceResult +# GetConsoleAccessResult ## Properties @@ -8,45 +8,45 @@ Name | Type | Description | Notes ## Methods -### NewGetConsoleAccessToInstanceResult +### NewGetConsoleAccessResult -`func NewGetConsoleAccessToInstanceResult() *GetConsoleAccessToInstanceResult` +`func NewGetConsoleAccessResult() *GetConsoleAccessResult` -NewGetConsoleAccessToInstanceResult instantiates a new GetConsoleAccessToInstanceResult object +NewGetConsoleAccessResult instantiates a new GetConsoleAccessResult object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed -### NewGetConsoleAccessToInstanceResultWithDefaults +### NewGetConsoleAccessResultWithDefaults -`func NewGetConsoleAccessToInstanceResultWithDefaults() *GetConsoleAccessToInstanceResult` +`func NewGetConsoleAccessResultWithDefaults() *GetConsoleAccessResult` -NewGetConsoleAccessToInstanceResultWithDefaults instantiates a new GetConsoleAccessToInstanceResult object +NewGetConsoleAccessResultWithDefaults instantiates a new GetConsoleAccessResult object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set ### GetUrl -`func (o *GetConsoleAccessToInstanceResult) GetUrl() string` +`func (o *GetConsoleAccessResult) GetUrl() string` GetUrl returns the Url field if non-nil, zero value otherwise. ### GetUrlOk -`func (o *GetConsoleAccessToInstanceResult) GetUrlOk() (*string, bool)` +`func (o *GetConsoleAccessResult) GetUrlOk() (*string, bool)` GetUrlOk returns a tuple with the Url field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetUrl -`func (o *GetConsoleAccessToInstanceResult) SetUrl(v string)` +`func (o *GetConsoleAccessResult) SetUrl(v string)` SetUrl sets Url field to given value. ### HasUrl -`func (o *GetConsoleAccessToInstanceResult) HasUrl() bool` +`func (o *GetConsoleAccessResult) HasUrl() bool` HasUrl returns a boolean if a field has been set. diff --git a/publiccloud/docs/PubliccloudAPI.md b/publiccloud/docs/PubliccloudAPI.md index d9db760..f209b5e 100644 --- a/publiccloud/docs/PubliccloudAPI.md +++ b/publiccloud/docs/PubliccloudAPI.md @@ -10,17 +10,19 @@ Method | HTTP request | Description [**CancelInstanceTermination**](PubliccloudAPI.md#CancelInstanceTermination) | **Post** /instances/{instanceId}/cancelTermination | Cancel instance termination [**CreateAutoScalingGroup**](PubliccloudAPI.md#CreateAutoScalingGroup) | **Post** /autoScalingGroups | Create Auto Scaling Group [**CreateImage**](PubliccloudAPI.md#CreateImage) | **Post** /images | Create Custom Image +[**CreateInstanceSnapshot**](PubliccloudAPI.md#CreateInstanceSnapshot) | **Post** /instances/{instanceId}/snapshots | Create instance snapshot [**CreateLoadBalancerListener**](PubliccloudAPI.md#CreateLoadBalancerListener) | **Post** /loadBalancers/{loadBalancerId}/listeners | Create listener -[**CreateSnapshot**](PubliccloudAPI.md#CreateSnapshot) | **Post** /instances/{instanceId}/snapshots | Create instance snapshot [**CreateTargetGroup**](PubliccloudAPI.md#CreateTargetGroup) | **Post** /targetGroups | Create Target Group +[**CreateVPSSnapshot**](PubliccloudAPI.md#CreateVPSSnapshot) | **Post** /vps/{vpsId}/snapshots | Create VPS snapshot [**DeleteAutoScalingGroup**](PubliccloudAPI.md#DeleteAutoScalingGroup) | **Delete** /autoScalingGroups/{autoScalingGroupId} | Delete Auto Scaling Group [**DeleteInstanceCredential**](PubliccloudAPI.md#DeleteInstanceCredential) | **Delete** /instances/{instanceId}/credentials/{type}/{username} | Delete Instance credential for a given type and username [**DeleteInstanceCredentials**](PubliccloudAPI.md#DeleteInstanceCredentials) | **Delete** /instances/{instanceId}/credentials | Delete all credentials associated with a specific Instance +[**DeleteInstanceSnapshot**](PubliccloudAPI.md#DeleteInstanceSnapshot) | **Delete** /instances/{instanceId}/snapshots/{snapshotId} | Delete instance snapshot [**DeleteLoadBalancerListener**](PubliccloudAPI.md#DeleteLoadBalancerListener) | **Delete** /loadBalancers/{loadBalancerId}/listeners/{listenerId} | Delete load balancer listener -[**DeleteSnapshot**](PubliccloudAPI.md#DeleteSnapshot) | **Delete** /instances/{instanceId}/snapshots/{snapshotId} | Delete instance snapshot [**DeleteTargetGroup**](PubliccloudAPI.md#DeleteTargetGroup) | **Delete** /targetGroups/{targetGroupId} | Delete Target Group [**DeleteVPSCredential**](PubliccloudAPI.md#DeleteVPSCredential) | **Delete** /vps/{vpsId}/credentials/{type}/{username} | Delete VPS credential [**DeleteVPSCredentials**](PubliccloudAPI.md#DeleteVPSCredentials) | **Delete** /vps/{vpsId}/credentials | Delete all credentials associated with a specific VPS +[**DeleteVPSSnapshot**](PubliccloudAPI.md#DeleteVPSSnapshot) | **Delete** /vps/{vpsId}/snapshots/{snapshotId} | Delete VPS snapshot [**DeregisterAutoScalingGroupTargetGroup**](PubliccloudAPI.md#DeregisterAutoScalingGroupTargetGroup) | **Post** /autoScalingGroups/{autoScalingGroupId}/deregisterTargetGroup | Deregister Target Group [**DeregisterTargets**](PubliccloudAPI.md#DeregisterTargets) | **Post** /targetGroups/{targetGroupId}/deregisterTargets | Deregister Targets [**DetachInstanceISO**](PubliccloudAPI.md#DetachInstanceISO) | **Post** /instances/{instanceId}/detachIso | Detach ISO from a specific Instance @@ -30,13 +32,13 @@ Method | HTTP request | Description [**GetAutoScalingGroupList**](PubliccloudAPI.md#GetAutoScalingGroupList) | **Get** /autoScalingGroups | Get Auto Scaling Group list [**GetConnectionsMetrics**](PubliccloudAPI.md#GetConnectionsMetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/connections | Get connections metrics [**GetConnectionsPerSecondMetrics**](PubliccloudAPI.md#GetConnectionsPerSecondMetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/connectionsPerSecond | Get connections per second metrics -[**GetConsoleAccessToInstance**](PubliccloudAPI.md#GetConsoleAccessToInstance) | **Get** /instances/{instanceId}/console | Get console access [**GetCpuMetrics**](PubliccloudAPI.md#GetCpuMetrics) | **Get** /instances/{instanceId}/metrics/cpu | Get instance CPU metrics [**GetDataTransferredMetrics**](PubliccloudAPI.md#GetDataTransferredMetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/dataTransferred | Get load balancer data transferred metrics [**GetDataTransferredPerSecondMetrics**](PubliccloudAPI.md#GetDataTransferredPerSecondMetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/dataTransferredPerSecond | Get load balancer data transferred per second metrics [**GetExpenses**](PubliccloudAPI.md#GetExpenses) | **Get** /equipments/{equipmentId}/expenses | Get costs for a given month. [**GetImageList**](PubliccloudAPI.md#GetImageList) | **Get** /images | List all available Images [**GetInstance**](PubliccloudAPI.md#GetInstance) | **Get** /instances/{instanceId} | Get instance details +[**GetInstanceConsoleAccess**](PubliccloudAPI.md#GetInstanceConsoleAccess) | **Get** /instances/{instanceId}/console | Get console access [**GetInstanceCredential**](PubliccloudAPI.md#GetInstanceCredential) | **Get** /instances/{instanceId}/credentials/{type}/{username} | Get Instance credentials by type and username. [**GetInstanceCredentialList**](PubliccloudAPI.md#GetInstanceCredentialList) | **Get** /instances/{instanceId}/credentials | List credentials stored for a specific Instance [**GetInstanceCredentialListByType**](PubliccloudAPI.md#GetInstanceCredentialListByType) | **Get** /instances/{instanceId}/credentials/{type} | Get credentials by type for a specific Instance @@ -44,6 +46,8 @@ Method | HTTP request | Description [**GetInstanceIP**](PubliccloudAPI.md#GetInstanceIP) | **Get** /instances/{instanceId}/ips/{ip} | Get IP details for a specific Instance [**GetInstanceIPList**](PubliccloudAPI.md#GetInstanceIPList) | **Get** /instances/{instanceId}/ips | List IP addresses associated with a specific Instance [**GetInstanceList**](PubliccloudAPI.md#GetInstanceList) | **Get** /instances | Get instance list +[**GetInstanceSnapshot**](PubliccloudAPI.md#GetInstanceSnapshot) | **Get** /instances/{instanceId}/snapshots/{snapshotId} | Get snapshot detail +[**GetInstanceSnapshotList**](PubliccloudAPI.md#GetInstanceSnapshotList) | **Get** /instances/{instanceId}/snapshots | List snapshots [**GetInstanceTypeList**](PubliccloudAPI.md#GetInstanceTypeList) | **Get** /instanceTypes | List instance types [**GetIsoList**](PubliccloudAPI.md#GetIsoList) | **Get** /isos | List available ISOs [**GetLoadBalancer**](PubliccloudAPI.md#GetLoadBalancer) | **Get** /loadBalancers/{loadBalancerId} | Get load balancer details @@ -61,18 +65,19 @@ Method | HTTP request | Description [**GetRequestsPerSecondMetrics**](PubliccloudAPI.md#GetRequestsPerSecondMetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/requestsPerSecond | Get load balancer requests per second metrics [**GetResponseCodesMetrics**](PubliccloudAPI.md#GetResponseCodesMetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/responseCodes | Get response codes metrics [**GetResponseCodesPerSecondMetrics**](PubliccloudAPI.md#GetResponseCodesPerSecondMetrics) | **Get** /loadBalancers/{loadBalancerId}/metrics/responseCodesPerSecond | Get response codes per second metrics -[**GetSnapshot**](PubliccloudAPI.md#GetSnapshot) | **Get** /instances/{instanceId}/snapshots/{snapshotId} | Get snapshot detail -[**GetSnapshotList**](PubliccloudAPI.md#GetSnapshotList) | **Get** /instances/{instanceId}/snapshots | List snapshots [**GetTargetGroup**](PubliccloudAPI.md#GetTargetGroup) | **Get** /targetGroups/{targetGroupId} | Get Target Group details [**GetTargetGroupList**](PubliccloudAPI.md#GetTargetGroupList) | **Get** /targetGroups | Get Target Group list [**GetTargetList**](PubliccloudAPI.md#GetTargetList) | **Get** /targetGroups/{targetGroupId}/targets | Get Targets [**GetUpdateInstanceTypeList**](PubliccloudAPI.md#GetUpdateInstanceTypeList) | **Get** /instances/{instanceId}/instanceTypesUpdate | List available instance types for update +[**GetVPSConsoleAccess**](PubliccloudAPI.md#GetVPSConsoleAccess) | **Get** /vps/{vpsId}/console | Get console access [**GetVPSCredential**](PubliccloudAPI.md#GetVPSCredential) | **Get** /vps/{vpsId}/credentials/{type}/{username} | Get VPS credential by type and username. [**GetVPSCredentialList**](PubliccloudAPI.md#GetVPSCredentialList) | **Get** /vps/{vpsId}/credentials | List credentials stored for a specific VPS [**GetVPSCredentialListByType**](PubliccloudAPI.md#GetVPSCredentialListByType) | **Get** /vps/{vpsId}/credentials/{type} | Get credentials by type for a specific VPS [**GetVPSDataTrafficMetrics**](PubliccloudAPI.md#GetVPSDataTrafficMetrics) | **Get** /vps/{vpsId}/metrics/datatraffic | Get data traffic metrics for a specific VPS [**GetVPSIP**](PubliccloudAPI.md#GetVPSIP) | **Get** /vps/{vpsId}/ips/{ip} | Get IP details for a specific VPS [**GetVPSIPList**](PubliccloudAPI.md#GetVPSIPList) | **Get** /vps/{vpsId}/ips | List IP addresses associated with a specific VPS +[**GetVPSSnapshot**](PubliccloudAPI.md#GetVPSSnapshot) | **Get** /vps/{vpsId}/snapshots/{snapshotId} | Get snapshot detail +[**GetVPSSnapshotList**](PubliccloudAPI.md#GetVPSSnapshotList) | **Get** /vps/{vpsId}/snapshots | List snapshots [**GetVps**](PubliccloudAPI.md#GetVps) | **Get** /vps/{vpsId} | Get VPS details [**GetVpsList**](PubliccloudAPI.md#GetVpsList) | **Get** /vps | Get VPS list [**LaunchInstance**](PubliccloudAPI.md#LaunchInstance) | **Post** /instances | Launch instance @@ -93,10 +98,11 @@ Method | HTTP request | Description [**RemoveVPSIPNullRoute**](PubliccloudAPI.md#RemoveVPSIPNullRoute) | **Post** /vps/{vpsId}/ips/{ip}/unnull | Remove an IP null route for a specific VPS [**ResetInstancePassword**](PubliccloudAPI.md#ResetInstancePassword) | **Post** /instances/{instanceId}/resetPassword | Reset the password for a specific Instance [**ResetVPSPassword**](PubliccloudAPI.md#ResetVPSPassword) | **Post** /vps/{vpsId}/resetPassword | Reset the password for a specific VPS -[**RestoreSnapshot**](PubliccloudAPI.md#RestoreSnapshot) | **Put** /instances/{instanceId}/snapshots/{snapshotId} | Restore instance snapshot +[**RestoreInstanceSnapshot**](PubliccloudAPI.md#RestoreInstanceSnapshot) | **Put** /instances/{instanceId}/snapshots/{snapshotId} | Restore instance snapshot +[**RestoreVPSSnapshot**](PubliccloudAPI.md#RestoreVPSSnapshot) | **Put** /vps/{vpsId}/snapshots/{snapshotId} | Restore VPS snapshot [**StartInstance**](PubliccloudAPI.md#StartInstance) | **Post** /instances/{instanceId}/start | Start a specific resource Instance [**StartLoadBalancer**](PubliccloudAPI.md#StartLoadBalancer) | **Post** /loadBalancers/{loadBalancerId}/start | Start a specific resource Load Balancer -[**StartVPS**](PubliccloudAPI.md#StartVPS) | **Post** /vps/{vpsId}/start | Start a specific resource VPS +[**StartVPS**](PubliccloudAPI.md#StartVPS) | **Post** /vps/{vpsId}/start | Start a specific VPS [**StopInstance**](PubliccloudAPI.md#StopInstance) | **Post** /instances/{instanceId}/stop | Stop a specific Instance [**StopLoadBalancer**](PubliccloudAPI.md#StopLoadBalancer) | **Post** /loadBalancers/{loadBalancerId}/stop | Stop a specific Load Balancer [**StopVPS**](PubliccloudAPI.md#StopVPS) | **Post** /vps/{vpsId}/stop | Stop a specific VPS @@ -277,7 +283,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID attachIsoOpts := *openapiclient.NewAttachIsoOpts("IsoId_example") // AttachIsoOpts | configuration := openapiclient.NewConfiguration() @@ -526,11 +532,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## CreateLoadBalancerListener +## CreateInstanceSnapshot -> LoadBalancerListener CreateLoadBalancerListener(ctx, loadBalancerId).LoadBalancerListenerCreateOpts(loadBalancerListenerCreateOpts).Execute() +> CreateInstanceSnapshot(ctx, instanceId).Execute() -Create listener +Create instance snapshot @@ -547,18 +553,15 @@ import ( ) func main() { - loadBalancerId := "695ddd91-051f-4dd6-9120-938a927a47d0" // string | Load balancer ID - loadBalancerListenerCreateOpts := *openapiclient.NewLoadBalancerListenerCreateOpts(openapiclient.protocol("HTTP"), int32(123), *openapiclient.NewLoadBalancerListenerDefaultRule("TargetGroupId_example")) // LoadBalancerListenerCreateOpts | + instanceId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | Instance's ID configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PubliccloudAPI.CreateLoadBalancerListener(context.Background(), loadBalancerId).LoadBalancerListenerCreateOpts(loadBalancerListenerCreateOpts).Execute() + r, err := apiClient.PubliccloudAPI.CreateInstanceSnapshot(context.Background(), instanceId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.CreateLoadBalancerListener``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.CreateInstanceSnapshot``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `CreateLoadBalancerListener`: LoadBalancerListener - fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.CreateLoadBalancerListener`: %v\n", resp) } ``` @@ -568,21 +571,20 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**loadBalancerId** | **string** | Load balancer ID | +**instanceId** | **string** | Instance's ID | ### Other Parameters -Other parameters are passed through a pointer to a apiCreateLoadBalancerListenerRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiCreateInstanceSnapshotRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loadBalancerListenerCreateOpts** | [**LoadBalancerListenerCreateOpts**](LoadBalancerListenerCreateOpts.md) | | ### Return type -[**LoadBalancerListener**](LoadBalancerListener.md) + (empty response body) ### Authorization @@ -590,7 +592,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -598,11 +600,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## CreateSnapshot +## CreateLoadBalancerListener -> CreateSnapshot(ctx, instanceId).Execute() +> LoadBalancerListener CreateLoadBalancerListener(ctx, loadBalancerId).LoadBalancerListenerCreateOpts(loadBalancerListenerCreateOpts).Execute() -Create instance snapshot +Create listener @@ -619,15 +621,18 @@ import ( ) func main() { - instanceId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | Instance's ID + loadBalancerId := "695ddd91-051f-4dd6-9120-938a927a47d0" // string | Load balancer ID + loadBalancerListenerCreateOpts := *openapiclient.NewLoadBalancerListenerCreateOpts(openapiclient.protocol("HTTP"), int32(123), *openapiclient.NewLoadBalancerListenerDefaultRule("TargetGroupId_example")) // LoadBalancerListenerCreateOpts | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PubliccloudAPI.CreateSnapshot(context.Background(), instanceId).Execute() + resp, r, err := apiClient.PubliccloudAPI.CreateLoadBalancerListener(context.Background(), loadBalancerId).LoadBalancerListenerCreateOpts(loadBalancerListenerCreateOpts).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.CreateSnapshot``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.CreateLoadBalancerListener``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } + // response from `CreateLoadBalancerListener`: LoadBalancerListener + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.CreateLoadBalancerListener`: %v\n", resp) } ``` @@ -637,20 +642,21 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**instanceId** | **string** | Instance's ID | +**loadBalancerId** | **string** | Load balancer ID | ### Other Parameters -Other parameters are passed through a pointer to a apiCreateSnapshotRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiCreateLoadBalancerListenerRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **loadBalancerListenerCreateOpts** | [**LoadBalancerListenerCreateOpts**](LoadBalancerListenerCreateOpts.md) | | ### Return type - (empty response body) +[**LoadBalancerListener**](LoadBalancerListener.md) ### Authorization @@ -658,7 +664,7 @@ Name | Type | Description | Notes ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) @@ -732,6 +738,74 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## CreateVPSSnapshot + +> CreateVPSSnapshot(ctx, vpsId).Execute() + +Create VPS snapshot + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" +) + +func main() { + vpsId := "999999999" // string | VPS ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PubliccloudAPI.CreateVPSSnapshot(context.Background(), vpsId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.CreateVPSSnapshot``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**vpsId** | **string** | VPS ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateVPSSnapshotRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +[X-LSW-Auth](../README.md#X-LSW-Auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## DeleteAutoScalingGroup > DeleteAutoScalingGroup(ctx, autoScalingGroupId).Execute() @@ -938,13 +1012,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## DeleteLoadBalancerListener - -> DeleteLoadBalancerListener(ctx, loadBalancerId, listenerId).Execute() - -Delete load balancer listener +## DeleteInstanceSnapshot +> DeleteInstanceSnapshot(ctx, instanceId, snapshotId).Execute() +Delete instance snapshot ### Example @@ -959,14 +1031,14 @@ import ( ) func main() { - loadBalancerId := "695ddd91-051f-4dd6-9120-938a927a47d0" // string | Load balancer ID - listenerId := "695ddd91-051f-4dd6-9120-938a927a47d0" // string | Listener ID + instanceId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | Instance's ID + snapshotId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PubliccloudAPI.DeleteLoadBalancerListener(context.Background(), loadBalancerId, listenerId).Execute() + r, err := apiClient.PubliccloudAPI.DeleteInstanceSnapshot(context.Background(), instanceId, snapshotId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.DeleteLoadBalancerListener``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.DeleteInstanceSnapshot``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } @@ -978,12 +1050,12 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**loadBalancerId** | **string** | Load balancer ID | -**listenerId** | **string** | Listener ID | +**instanceId** | **string** | Instance's ID | +**snapshotId** | **string** | | ### Other Parameters -Other parameters are passed through a pointer to a apiDeleteLoadBalancerListenerRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteInstanceSnapshotRequest struct via the builder pattern Name | Type | Description | Notes @@ -1009,11 +1081,13 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## DeleteSnapshot +## DeleteLoadBalancerListener + +> DeleteLoadBalancerListener(ctx, loadBalancerId, listenerId).Execute() + +Delete load balancer listener -> DeleteSnapshot(ctx, instanceId, snapshotId).Execute() -Delete instance snapshot ### Example @@ -1028,14 +1102,14 @@ import ( ) func main() { - instanceId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | Instance's ID - snapshotId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | + loadBalancerId := "695ddd91-051f-4dd6-9120-938a927a47d0" // string | Load balancer ID + listenerId := "695ddd91-051f-4dd6-9120-938a927a47d0" // string | Listener ID configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PubliccloudAPI.DeleteSnapshot(context.Background(), instanceId, snapshotId).Execute() + r, err := apiClient.PubliccloudAPI.DeleteLoadBalancerListener(context.Background(), loadBalancerId, listenerId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.DeleteSnapshot``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.DeleteLoadBalancerListener``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } @@ -1047,12 +1121,12 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**instanceId** | **string** | Instance's ID | -**snapshotId** | **string** | | +**loadBalancerId** | **string** | Load balancer ID | +**listenerId** | **string** | Listener ID | ### Other Parameters -Other parameters are passed through a pointer to a apiDeleteSnapshotRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiDeleteLoadBalancerListenerRequest struct via the builder pattern Name | Type | Description | Notes @@ -1165,7 +1239,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID type_ := openapiclient.credentialType("OPERATING_SYSTEM") // CredentialType | Type of credential username := "root" // string | Username @@ -1239,7 +1313,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1268,6 +1342,75 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +### Return type + + (empty response body) + +### Authorization + +[X-LSW-Auth](../README.md#X-LSW-Auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteVPSSnapshot + +> DeleteVPSSnapshot(ctx, vpsId, snapshotId).Execute() + +Delete VPS snapshot + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" +) + +func main() { + vpsId := "999999999" // string | VPS ID + snapshotId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PubliccloudAPI.DeleteVPSSnapshot(context.Background(), vpsId, snapshotId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.DeleteVPSSnapshot``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**vpsId** | **string** | VPS ID | +**snapshotId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteVPSSnapshotRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + ### Return type (empty response body) @@ -1517,7 +1660,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -1938,13 +2081,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetConsoleAccessToInstance - -> GetConsoleAccessToInstanceResult GetConsoleAccessToInstance(ctx, instanceId).Execute() - -Get console access +## GetCpuMetrics +> GetCpuMetricsResult GetCpuMetrics(ctx, instanceId).From(from).To(to).Granularity(granularity).Execute() +Get instance CPU metrics ### Example @@ -1955,21 +2096,25 @@ import ( "context" "fmt" "os" + "time" openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" ) func main() { instanceId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | Instance's ID + from := time.Now() // string | The start of the interval to get the metric (optional) + to := time.Now() // string | The end of the interval to get the metric. Must be greater than the date provided in `from` (optional) + granularity := openapiclient.metricsGranularity("5m") // MetricsGranularity | The interval for each metric (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PubliccloudAPI.GetConsoleAccessToInstance(context.Background(), instanceId).Execute() + resp, r, err := apiClient.PubliccloudAPI.GetCpuMetrics(context.Background(), instanceId).From(from).To(to).Granularity(granularity).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetConsoleAccessToInstance``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetCpuMetrics``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetConsoleAccessToInstance`: GetConsoleAccessToInstanceResult - fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetConsoleAccessToInstance`: %v\n", resp) + // response from `GetCpuMetrics`: GetCpuMetricsResult + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetCpuMetrics`: %v\n", resp) } ``` @@ -1983,16 +2128,19 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiGetConsoleAccessToInstanceRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetCpuMetricsRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **from** | **string** | The start of the interval to get the metric | + **to** | **string** | The end of the interval to get the metric. Must be greater than the date provided in `from` | + **granularity** | [**MetricsGranularity**](MetricsGranularity.md) | The interval for each metric | ### Return type -[**GetConsoleAccessToInstanceResult**](GetConsoleAccessToInstanceResult.md) +[**GetCpuMetricsResult**](GetCpuMetricsResult.md) ### Authorization @@ -2008,11 +2156,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetCpuMetrics +## GetDataTransferredMetrics -> GetCpuMetricsResult GetCpuMetrics(ctx, instanceId).From(from).To(to).Granularity(granularity).Execute() +> GetDataTransferredMetricsResult GetDataTransferredMetrics(ctx, loadBalancerId).From(from).To(to).Granularity(granularity).Execute() -Get instance CPU metrics +Get load balancer data transferred metrics ### Example @@ -2028,20 +2176,20 @@ import ( ) func main() { - instanceId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | Instance's ID + loadBalancerId := "695ddd91-051f-4dd6-9120-938a927a47d0" // string | Load balancer ID from := time.Now() // string | The start of the interval to get the metric (optional) to := time.Now() // string | The end of the interval to get the metric. Must be greater than the date provided in `from` (optional) granularity := openapiclient.metricsGranularity("5m") // MetricsGranularity | The interval for each metric (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PubliccloudAPI.GetCpuMetrics(context.Background(), instanceId).From(from).To(to).Granularity(granularity).Execute() + resp, r, err := apiClient.PubliccloudAPI.GetDataTransferredMetrics(context.Background(), loadBalancerId).From(from).To(to).Granularity(granularity).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetCpuMetrics``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetDataTransferredMetrics``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetCpuMetrics`: GetCpuMetricsResult - fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetCpuMetrics`: %v\n", resp) + // response from `GetDataTransferredMetrics`: GetDataTransferredMetricsResult + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetDataTransferredMetrics`: %v\n", resp) } ``` @@ -2051,11 +2199,11 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**instanceId** | **string** | Instance's ID | +**loadBalancerId** | **string** | Load balancer ID | ### Other Parameters -Other parameters are passed through a pointer to a apiGetCpuMetricsRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetDataTransferredMetricsRequest struct via the builder pattern Name | Type | Description | Notes @@ -2067,7 +2215,7 @@ Name | Type | Description | Notes ### Return type -[**GetCpuMetricsResult**](GetCpuMetricsResult.md) +[**GetDataTransferredMetricsResult**](GetDataTransferredMetricsResult.md) ### Authorization @@ -2083,11 +2231,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetDataTransferredMetrics +## GetDataTransferredPerSecondMetrics -> GetDataTransferredMetricsResult GetDataTransferredMetrics(ctx, loadBalancerId).From(from).To(to).Granularity(granularity).Execute() +> GetDataTransferredPerSecondMetricsResult GetDataTransferredPerSecondMetrics(ctx, loadBalancerId).From(from).To(to).Granularity(granularity).Execute() -Get load balancer data transferred metrics +Get load balancer data transferred per second metrics ### Example @@ -2110,13 +2258,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PubliccloudAPI.GetDataTransferredMetrics(context.Background(), loadBalancerId).From(from).To(to).Granularity(granularity).Execute() + resp, r, err := apiClient.PubliccloudAPI.GetDataTransferredPerSecondMetrics(context.Background(), loadBalancerId).From(from).To(to).Granularity(granularity).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetDataTransferredMetrics``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetDataTransferredPerSecondMetrics``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetDataTransferredMetrics`: GetDataTransferredMetricsResult - fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetDataTransferredMetrics`: %v\n", resp) + // response from `GetDataTransferredPerSecondMetrics`: GetDataTransferredPerSecondMetricsResult + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetDataTransferredPerSecondMetrics`: %v\n", resp) } ``` @@ -2130,7 +2278,7 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiGetDataTransferredMetricsRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetDataTransferredPerSecondMetricsRequest struct via the builder pattern Name | Type | Description | Notes @@ -2142,7 +2290,7 @@ Name | Type | Description | Notes ### Return type -[**GetDataTransferredMetricsResult**](GetDataTransferredMetricsResult.md) +[**GetDataTransferredPerSecondMetricsResult**](GetDataTransferredPerSecondMetricsResult.md) ### Authorization @@ -2158,11 +2306,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetDataTransferredPerSecondMetrics +## GetExpenses -> GetDataTransferredPerSecondMetricsResult GetDataTransferredPerSecondMetrics(ctx, loadBalancerId).From(from).To(to).Granularity(granularity).Execute() +> GetExpensesResult GetExpenses(ctx, equipmentId).From(from).To(to).Execute() -Get load balancer data transferred per second metrics +Get costs for a given month. ### Example @@ -2178,20 +2326,19 @@ import ( ) func main() { - loadBalancerId := "695ddd91-051f-4dd6-9120-938a927a47d0" // string | Load balancer ID - from := time.Now() // string | The start of the interval to get the metric (optional) - to := time.Now() // string | The end of the interval to get the metric. Must be greater than the date provided in `from` (optional) - granularity := openapiclient.metricsGranularity("5m") // MetricsGranularity | The interval for each metric (optional) + equipmentId := "695ddd91-051f-4dd6-9120-938a927a47d0" // string | Equipment's UUID + from := time.Now() // string | Start date of the period to get costs for. It must be the first day of the month + to := time.Now() // string | End date of the period to get costs for. This date needs to be exactly one month after the 'from' date. If this value is not passed, it will be calculated based on 'from' parameter (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PubliccloudAPI.GetDataTransferredPerSecondMetrics(context.Background(), loadBalancerId).From(from).To(to).Granularity(granularity).Execute() + resp, r, err := apiClient.PubliccloudAPI.GetExpenses(context.Background(), equipmentId).From(from).To(to).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetDataTransferredPerSecondMetrics``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetExpenses``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetDataTransferredPerSecondMetrics`: GetDataTransferredPerSecondMetricsResult - fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetDataTransferredPerSecondMetrics`: %v\n", resp) + // response from `GetExpenses`: GetExpensesResult + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetExpenses`: %v\n", resp) } ``` @@ -2201,23 +2348,22 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**loadBalancerId** | **string** | Load balancer ID | +**equipmentId** | **string** | Equipment's UUID | ### Other Parameters -Other parameters are passed through a pointer to a apiGetDataTransferredPerSecondMetricsRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetExpensesRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **from** | **string** | The start of the interval to get the metric | - **to** | **string** | The end of the interval to get the metric. Must be greater than the date provided in `from` | - **granularity** | [**MetricsGranularity**](MetricsGranularity.md) | The interval for each metric | + **from** | **string** | Start date of the period to get costs for. It must be the first day of the month | + **to** | **string** | End date of the period to get costs for. This date needs to be exactly one month after the 'from' date. If this value is not passed, it will be calculated based on 'from' parameter | ### Return type -[**GetDataTransferredPerSecondMetricsResult**](GetDataTransferredPerSecondMetricsResult.md) +[**GetExpensesResult**](GetExpensesResult.md) ### Authorization @@ -2233,11 +2379,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetExpenses +## GetImageList -> GetExpensesResult GetExpenses(ctx, equipmentId).From(from).To(to).Execute() +> GetImageListResult GetImageList(ctx).Limit(limit).Offset(offset).Custom(custom).Standard(standard).State(state).MarketAppId(marketAppId).StorageType(storageType).Name(name).Flavour(flavour).Region(region).Execute() -Get costs for a given month. +List all available Images ### Example @@ -2248,49 +2394,58 @@ import ( "context" "fmt" "os" - "time" openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" ) func main() { - equipmentId := "695ddd91-051f-4dd6-9120-938a927a47d0" // string | Equipment's UUID - from := time.Now() // string | Start date of the period to get costs for. It must be the first day of the month - to := time.Now() // string | End date of the period to get costs for. This date needs to be exactly one month after the 'from' date. If this value is not passed, it will be calculated based on 'from' parameter (optional) + limit := int32(20) // int32 | Limit the number of results returned. (optional) + offset := int32(10) // int32 | Return results starting from the given offset. (optional) + custom := true // bool | Filters the list to include only custom images. (optional) + standard := true // bool | Filters the list to include only standard images. (optional) + state := openapiclient.imageState("CREATING") // ImageState | Filters the list by the state of custom images. (optional) + marketAppId := openapiclient.marketAppId("CPANEL_30") // MarketAppId | Filters the list by the market app of standard images. (optional) + storageType := openapiclient.storageType("LOCAL") // StorageType | Filters the list by the market app of standard images. (optional) + name := "Ubuntu 20.04 LTS (x86_64)" // string | Filters the list by the name of images. (optional) + flavour := openapiclient.flavour("ubuntu") // Flavour | Filters the list by the flavour of standard images. (optional) + region := "eu-west-3" // string | Available regions can be found using the List Regions endpoint. (optional) configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PubliccloudAPI.GetExpenses(context.Background(), equipmentId).From(from).To(to).Execute() + resp, r, err := apiClient.PubliccloudAPI.GetImageList(context.Background()).Limit(limit).Offset(offset).Custom(custom).Standard(standard).State(state).MarketAppId(marketAppId).StorageType(storageType).Name(name).Flavour(flavour).Region(region).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetExpenses``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetImageList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetExpenses`: GetExpensesResult - fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetExpenses`: %v\n", resp) + // response from `GetImageList`: GetImageListResult + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetImageList`: %v\n", resp) } ``` ### Path Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**equipmentId** | **string** | Equipment's UUID | ### Other Parameters -Other parameters are passed through a pointer to a apiGetExpensesRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetImageListRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - **from** | **string** | Start date of the period to get costs for. It must be the first day of the month | - **to** | **string** | End date of the period to get costs for. This date needs to be exactly one month after the 'from' date. If this value is not passed, it will be calculated based on 'from' parameter | + **limit** | **int32** | Limit the number of results returned. | + **offset** | **int32** | Return results starting from the given offset. | + **custom** | **bool** | Filters the list to include only custom images. | + **standard** | **bool** | Filters the list to include only standard images. | + **state** | [**ImageState**](ImageState.md) | Filters the list by the state of custom images. | + **marketAppId** | [**MarketAppId**](MarketAppId.md) | Filters the list by the market app of standard images. | + **storageType** | [**StorageType**](StorageType.md) | Filters the list by the market app of standard images. | + **name** | **string** | Filters the list by the name of images. | + **flavour** | [**Flavour**](Flavour.md) | Filters the list by the flavour of standard images. | + **region** | **string** | Available regions can be found using the List Regions endpoint. | ### Return type -[**GetExpensesResult**](GetExpensesResult.md) +[**GetImageListResult**](GetImageListResult.md) ### Authorization @@ -2306,11 +2461,13 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetImageList +## GetInstance + +> InstanceDetails GetInstance(ctx, instanceId).Execute() + +Get instance details -> GetImageListResult GetImageList(ctx).Limit(limit).Offset(offset).Custom(custom).Standard(standard).State(state).MarketAppId(marketAppId).StorageType(storageType).Name(name).Flavour(flavour).Region(region).Execute() -List all available Images ### Example @@ -2325,54 +2482,40 @@ import ( ) func main() { - limit := int32(20) // int32 | Limit the number of results returned. (optional) - offset := int32(10) // int32 | Return results starting from the given offset. (optional) - custom := true // bool | Filters the list to include only custom images. (optional) - standard := true // bool | Filters the list to include only standard images. (optional) - state := openapiclient.imageState("CREATING") // ImageState | Filters the list by the state of custom images. (optional) - marketAppId := openapiclient.marketAppId("CPANEL_30") // MarketAppId | Filters the list by the market app of standard images. (optional) - storageType := openapiclient.storageType("LOCAL") // StorageType | Filters the list by the market app of standard images. (optional) - name := "Ubuntu 20.04 LTS (x86_64)" // string | Filters the list by the name of images. (optional) - flavour := openapiclient.flavour("ubuntu") // Flavour | Filters the list by the flavour of standard images. (optional) - region := "eu-west-3" // string | Available regions can be found using the List Regions endpoint. (optional) + instanceId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | Instance's ID configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PubliccloudAPI.GetImageList(context.Background()).Limit(limit).Offset(offset).Custom(custom).Standard(standard).State(state).MarketAppId(marketAppId).StorageType(storageType).Name(name).Flavour(flavour).Region(region).Execute() + resp, r, err := apiClient.PubliccloudAPI.GetInstance(context.Background(), instanceId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetImageList``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetInstance``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetImageList`: GetImageListResult - fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetImageList`: %v\n", resp) + // response from `GetInstance`: InstanceDetails + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetInstance`: %v\n", resp) } ``` ### Path Parameters +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**instanceId** | **string** | Instance's ID | ### Other Parameters -Other parameters are passed through a pointer to a apiGetImageListRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetInstanceRequest struct via the builder pattern Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **limit** | **int32** | Limit the number of results returned. | - **offset** | **int32** | Return results starting from the given offset. | - **custom** | **bool** | Filters the list to include only custom images. | - **standard** | **bool** | Filters the list to include only standard images. | - **state** | [**ImageState**](ImageState.md) | Filters the list by the state of custom images. | - **marketAppId** | [**MarketAppId**](MarketAppId.md) | Filters the list by the market app of standard images. | - **storageType** | [**StorageType**](StorageType.md) | Filters the list by the market app of standard images. | - **name** | **string** | Filters the list by the name of images. | - **flavour** | [**Flavour**](Flavour.md) | Filters the list by the flavour of standard images. | - **region** | **string** | Available regions can be found using the List Regions endpoint. | + ### Return type -[**GetImageListResult**](GetImageListResult.md) +[**InstanceDetails**](InstanceDetails.md) ### Authorization @@ -2388,11 +2531,11 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## GetInstance +## GetInstanceConsoleAccess -> InstanceDetails GetInstance(ctx, instanceId).Execute() +> GetConsoleAccessResult GetInstanceConsoleAccess(ctx, instanceId).Execute() -Get instance details +Get console access @@ -2413,13 +2556,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PubliccloudAPI.GetInstance(context.Background(), instanceId).Execute() + resp, r, err := apiClient.PubliccloudAPI.GetInstanceConsoleAccess(context.Background(), instanceId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetInstance``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetInstanceConsoleAccess``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `GetInstance`: InstanceDetails - fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetInstance`: %v\n", resp) + // response from `GetInstanceConsoleAccess`: GetConsoleAccessResult + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetInstanceConsoleAccess`: %v\n", resp) } ``` @@ -2433,7 +2576,7 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiGetInstanceRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiGetInstanceConsoleAccessRequest struct via the builder pattern Name | Type | Description | Notes @@ -2442,7 +2585,7 @@ Name | Type | Description | Notes ### Return type -[**InstanceDetails**](InstanceDetails.md) +[**GetConsoleAccessResult**](GetConsoleAccessResult.md) ### Authorization @@ -2981,6 +3124,151 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## GetInstanceSnapshot + +> Snapshot GetInstanceSnapshot(ctx, instanceId, snapshotId).Execute() + +Get snapshot detail + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" +) + +func main() { + instanceId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | Instance's ID + snapshotId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PubliccloudAPI.GetInstanceSnapshot(context.Background(), instanceId, snapshotId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetInstanceSnapshot``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInstanceSnapshot`: Snapshot + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetInstanceSnapshot`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**instanceId** | **string** | Instance's ID | +**snapshotId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInstanceSnapshotRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**Snapshot**](Snapshot.md) + +### Authorization + +[X-LSW-Auth](../README.md#X-LSW-Auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetInstanceSnapshotList + +> GetSnapshotListResult GetInstanceSnapshotList(ctx, instanceId).Limit(limit).Offset(offset).Execute() + +List snapshots + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" +) + +func main() { + instanceId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | Instance's ID + limit := int32(20) // int32 | Limit the number of results returned. (optional) + offset := int32(10) // int32 | Return results starting from the given offset. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PubliccloudAPI.GetInstanceSnapshotList(context.Background(), instanceId).Limit(limit).Offset(offset).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetInstanceSnapshotList``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInstanceSnapshotList`: GetSnapshotListResult + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetInstanceSnapshotList`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**instanceId** | **string** | Instance's ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetInstanceSnapshotListRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **int32** | Limit the number of results returned. | + **offset** | **int32** | Return results starting from the given offset. | + +### Return type + +[**GetSnapshotListResult**](GetSnapshotListResult.md) + +### Authorization + +[X-LSW-Auth](../README.md#X-LSW-Auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## GetInstanceTypeList > InstanceTypes GetInstanceTypeList(ctx).Region(region).Limit(limit).Offset(offset).Execute() @@ -3866,7 +4154,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID limit := int32(20) // int32 | Limit the number of results returned. (optional) offset := int32(10) // int32 | Return results starting from the given offset. (optional) custom := true // bool | Filters the list to include only custom images. (optional) @@ -4203,156 +4491,11 @@ Name | Type | Description | Notes **from** | **string** | The start of the interval to get the metric | **to** | **string** | The end of the interval to get the metric. Must be greater than the date provided in `from` | - **granularity** | **string** | The interval for each metric | - -### Return type - -[**GetResponseCodesPerSecondMetricsResult**](GetResponseCodesPerSecondMetricsResult.md) - -### Authorization - -[X-LSW-Auth](../README.md#X-LSW-Auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetSnapshot - -> Snapshot GetSnapshot(ctx, instanceId, snapshotId).Execute() - -Get snapshot detail - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" -) - -func main() { - instanceId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | Instance's ID - snapshotId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PubliccloudAPI.GetSnapshot(context.Background(), instanceId, snapshotId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetSnapshot``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetSnapshot`: Snapshot - fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetSnapshot`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**instanceId** | **string** | Instance's ID | -**snapshotId** | **string** | | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetSnapshotRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - -[**Snapshot**](Snapshot.md) - -### Authorization - -[X-LSW-Auth](../README.md#X-LSW-Auth) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetSnapshotList - -> GetSnapshotListResult GetSnapshotList(ctx, instanceId).Limit(limit).Offset(offset).Execute() - -List snapshots - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" -) - -func main() { - instanceId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | Instance's ID - limit := int32(20) // int32 | Limit the number of results returned. (optional) - offset := int32(10) // int32 | Return results starting from the given offset. (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PubliccloudAPI.GetSnapshotList(context.Background(), instanceId).Limit(limit).Offset(offset).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetSnapshotList``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetSnapshotList`: GetSnapshotListResult - fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetSnapshotList`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**instanceId** | **string** | Instance's ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetSnapshotListRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **limit** | **int32** | Limit the number of results returned. | - **offset** | **int32** | Return results starting from the given offset. | + **granularity** | **string** | The interval for each metric | ### Return type -[**GetSnapshotListResult**](GetSnapshotListResult.md) +[**GetResponseCodesPerSecondMetricsResult**](GetResponseCodesPerSecondMetricsResult.md) ### Authorization @@ -4664,6 +4807,76 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## GetVPSConsoleAccess + +> GetConsoleAccessResult GetVPSConsoleAccess(ctx, vpsId).Execute() + +Get console access + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" +) + +func main() { + vpsId := "999999999" // string | VPS ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PubliccloudAPI.GetVPSConsoleAccess(context.Background(), vpsId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetVPSConsoleAccess``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVPSConsoleAccess`: GetConsoleAccessResult + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetVPSConsoleAccess`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**vpsId** | **string** | VPS ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVPSConsoleAccessRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**GetConsoleAccessResult**](GetConsoleAccessResult.md) + +### Authorization + +[X-LSW-Auth](../README.md#X-LSW-Auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## GetVPSCredential > GetCredentialResult GetVPSCredential(ctx, vpsId, type_, username).Execute() @@ -4683,7 +4896,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID type_ := openapiclient.credentialType("OPERATING_SYSTEM") // CredentialType | Type of credential username := "root" // string | Username @@ -4757,7 +4970,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -4825,7 +5038,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID type_ := openapiclient.credentialType("OPERATING_SYSTEM") // CredentialType | Type of credential configuration := openapiclient.NewConfiguration() @@ -4897,7 +5110,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID from := time.Now() // string | The start of the interval to get the metric (optional) to := time.Now() // string | The end of the interval to get the metric. Must be greater than the date provided in `from` (optional) granularity := "granularity_example" // string | How the metrics are grouped by (optional) @@ -4973,7 +5186,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID ip := "10.0.0.1" // string | configuration := openapiclient.NewConfiguration() @@ -5046,7 +5259,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID version := openapiclient.ipVersion(4) // IpVersion | (optional) nullRouted := true // bool | (optional) ips := "ips_example" // string | A list of IPs separated by `|` (optional) @@ -5101,6 +5314,151 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## GetVPSSnapshot + +> Snapshot GetVPSSnapshot(ctx, vpsId, snapshotId).Execute() + +Get snapshot detail + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" +) + +func main() { + vpsId := "999999999" // string | VPS ID + snapshotId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PubliccloudAPI.GetVPSSnapshot(context.Background(), vpsId, snapshotId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetVPSSnapshot``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVPSSnapshot`: Snapshot + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetVPSSnapshot`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**vpsId** | **string** | VPS ID | +**snapshotId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVPSSnapshotRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + +[**Snapshot**](Snapshot.md) + +### Authorization + +[X-LSW-Auth](../README.md#X-LSW-Auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetVPSSnapshotList + +> GetSnapshotListResult GetVPSSnapshotList(ctx, vpsId).Limit(limit).Offset(offset).Execute() + +List snapshots + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" +) + +func main() { + vpsId := "999999999" // string | VPS ID + limit := int32(20) // int32 | Limit the number of results returned. (optional) + offset := int32(10) // int32 | Return results starting from the given offset. (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PubliccloudAPI.GetVPSSnapshotList(context.Background(), vpsId).Limit(limit).Offset(offset).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.GetVPSSnapshotList``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVPSSnapshotList`: GetSnapshotListResult + fmt.Fprintf(os.Stdout, "Response from `PubliccloudAPI.GetVPSSnapshotList`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**vpsId** | **string** | VPS ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVPSSnapshotListRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **int32** | Limit the number of results returned. | + **offset** | **int32** | Return results starting from the given offset. | + +### Return type + +[**GetSnapshotListResult**](GetSnapshotListResult.md) + +### Authorization + +[X-LSW-Auth](../README.md#X-LSW-Auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## GetVps > VpsDetails GetVps(ctx, vpsId).Execute() @@ -5122,7 +5480,7 @@ import ( ) func main() { - vpsId := "123581321" // string | Vps ID + vpsId := "999999999" // string | VPS ID configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -5142,7 +5500,7 @@ func main() { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**vpsId** | **string** | Vps ID | +**vpsId** | **string** | VPS ID | ### Other Parameters @@ -5194,7 +5552,7 @@ import ( func main() { limit := int32(20) // int32 | Limit the number of results returned. (optional) offset := int32(10) // int32 | Return results starting from the given offset. (optional) - id := "123581321" // string | Equipment Id (optional) + id := "999999999" // string | VPS Equipment Id (optional) reference := "Foo bar" // string | (optional) state := openapiclient.vpsState("RUNNING") // VpsState | (optional) pack := openapiclient.vpsPackType("Leaseweb VPS 1") // VpsPackType | (optional) @@ -5225,7 +5583,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **limit** | **int32** | Limit the number of results returned. | **offset** | **int32** | Return results starting from the given offset. | - **id** | **string** | Equipment Id | + **id** | **string** | VPS Equipment Id | **reference** | **string** | | **state** | [**VpsState**](VpsState.md) | | **pack** | [**VpsPackType**](VpsPackType.md) | | @@ -5552,7 +5910,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID ip := "10.0.0.1" // string | nullRouteIPOpts := *openapiclient.NewNullRouteIPOpts() // NullRouteIPOpts | (optional) @@ -5763,7 +6121,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -6043,7 +6401,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID reinstallResourceOpts := *openapiclient.NewReinstallResourceOpts("ImageId_example") // ReinstallResourceOpts | configuration := openapiclient.NewConfiguration() @@ -6327,7 +6685,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID ip := "10.0.0.1" // string | configuration := openapiclient.NewConfiguration() @@ -6468,7 +6826,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -6515,9 +6873,9 @@ Name | Type | Description | Notes [[Back to README]](../README.md) -## RestoreSnapshot +## RestoreInstanceSnapshot -> RestoreSnapshot(ctx, instanceId, snapshotId).Execute() +> RestoreInstanceSnapshot(ctx, instanceId, snapshotId).Execute() Restore instance snapshot @@ -6539,9 +6897,9 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PubliccloudAPI.RestoreSnapshot(context.Background(), instanceId, snapshotId).Execute() + r, err := apiClient.PubliccloudAPI.RestoreInstanceSnapshot(context.Background(), instanceId, snapshotId).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.RestoreSnapshot``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.RestoreInstanceSnapshot``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } } @@ -6558,7 +6916,76 @@ Name | Type | Description | Notes ### Other Parameters -Other parameters are passed through a pointer to a apiRestoreSnapshotRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiRestoreInstanceSnapshotRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +[X-LSW-Auth](../README.md#X-LSW-Auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## RestoreVPSSnapshot + +> RestoreVPSSnapshot(ctx, vpsId, snapshotId).Execute() + +Restore VPS snapshot + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/leaseweb/leaseweb-go-sdk/publiccloud" +) + +func main() { + vpsId := "999999999" // string | VPS ID + snapshotId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PubliccloudAPI.RestoreVPSSnapshot(context.Background(), vpsId, snapshotId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PubliccloudAPI.RestoreVPSSnapshot``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**vpsId** | **string** | VPS ID | +**snapshotId** | **string** | | + +### Other Parameters + +Other parameters are passed through a pointer to a apiRestoreVPSSnapshotRequest struct via the builder pattern Name | Type | Description | Notes @@ -6724,7 +7151,7 @@ Name | Type | Description | Notes > StartVPS(ctx, vpsId).Execute() -Start a specific resource VPS +Start a specific VPS @@ -6741,7 +7168,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -6945,7 +7372,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) @@ -7081,7 +7508,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID storeCredentialOpts := *openapiclient.NewStoreCredentialOpts(openapiclient.credentialType("OPERATING_SYSTEM"), "Username_example", "Password_example") // StoreCredentialOpts | configuration := openapiclient.NewConfiguration() @@ -7948,7 +8375,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID ip := "10.0.0.1" // string | updateIPOpts := *openapiclient.NewUpdateIPOpts("ReverseLookup_example") // UpdateIPOpts | @@ -8021,7 +8448,7 @@ import ( ) func main() { - vpsId := "ace712e9-a166-47f1-9065-4af0f7e7fce1" // string | VPS ID + vpsId := "999999999" // string | VPS ID type_ := openapiclient.credentialType("OPERATING_SYSTEM") // CredentialType | Type of credential username := "root" // string | Username updateCredentialOpts := *openapiclient.NewUpdateCredentialOpts("Password_example") // UpdateCredentialOpts | diff --git a/publiccloud/docs/VpsBase.md b/publiccloud/docs/VpsBase.md index eff15c4..9eb30e9 100644 --- a/publiccloud/docs/VpsBase.md +++ b/publiccloud/docs/VpsBase.md @@ -6,7 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **string** | | **Pack** | [**VpsPackType**](VpsPackType.md) | | -**Resources** | [**BaseResources**](BaseResources.md) | | **Region** | [**RegionName**](RegionName.md) | | **Datacenter** | [**Datacenter**](Datacenter.md) | | **Reference** | **string** | The identifying name set to the instance | @@ -16,13 +15,12 @@ Name | Type | Description | Notes **HasPublicIpV4** | **bool** | | **RootDiskSize** | **int32** | The root disk's size in GB. Must be at least 5 GB for Linux and FreeBSD instances and 50 GB for Windows instances | **StartedAt** | **NullableTime** | Date and time when the VPS was started for the first time, right after launching it | -**Contract** | [**VpsContract**](VpsContract.md) | | ## Methods ### NewVpsBase -`func NewVpsBase(id string, pack VpsPackType, resources BaseResources, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime, contract VpsContract, ) *VpsBase` +`func NewVpsBase(id string, pack VpsPackType, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime, ) *VpsBase` NewVpsBase instantiates a new VpsBase object This constructor will assign default values to properties that have it defined, @@ -77,26 +75,6 @@ and a boolean to check if the value has been set. SetPack sets Pack field to given value. -### GetResources - -`func (o *VpsBase) GetResources() BaseResources` - -GetResources returns the Resources field if non-nil, zero value otherwise. - -### GetResourcesOk - -`func (o *VpsBase) GetResourcesOk() (*BaseResources, bool)` - -GetResourcesOk returns a tuple with the Resources field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetResources - -`func (o *VpsBase) SetResources(v BaseResources)` - -SetResources sets Resources field to given value. - - ### GetRegion `func (o *VpsBase) GetRegion() RegionName` @@ -302,26 +280,6 @@ SetStartedAt sets StartedAt field to given value. `func (o *VpsBase) UnsetStartedAt()` UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil -### GetContract - -`func (o *VpsBase) GetContract() VpsContract` - -GetContract returns the Contract field if non-nil, zero value otherwise. - -### GetContractOk - -`func (o *VpsBase) GetContractOk() (*VpsContract, bool)` - -GetContractOk returns a tuple with the Contract field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetContract - -`func (o *VpsBase) SetContract(v VpsContract)` - -SetContract sets Contract field to given value. - - [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/publiccloud/docs/VpsContract.md b/publiccloud/docs/VpsContract.md index 6a4162b..92da3f2 100644 --- a/publiccloud/docs/VpsContract.md +++ b/publiccloud/docs/VpsContract.md @@ -14,12 +14,13 @@ Name | Type | Description | Notes **Sla** | **string** | | **ControlPanel** | **NullableString** | | **InModification** | **bool** | | +**DataTraffic** | [**DataTraffic**](DataTraffic.md) | | ## Methods ### NewVpsContract -`func NewVpsContract(billingFrequency BillingFrequency, term ContractTerm, type_ ContractType, endsAt NullableTime, createdAt time.Time, state ContractState, id string, sla string, controlPanel NullableString, inModification bool, ) *VpsContract` +`func NewVpsContract(billingFrequency BillingFrequency, term ContractTerm, type_ ContractType, endsAt NullableTime, createdAt time.Time, state ContractState, id string, sla string, controlPanel NullableString, inModification bool, dataTraffic DataTraffic, ) *VpsContract` NewVpsContract instantiates a new VpsContract object This constructor will assign default values to properties that have it defined, @@ -254,6 +255,26 @@ and a boolean to check if the value has been set. SetInModification sets InModification field to given value. +### GetDataTraffic + +`func (o *VpsContract) GetDataTraffic() DataTraffic` + +GetDataTraffic returns the DataTraffic field if non-nil, zero value otherwise. + +### GetDataTrafficOk + +`func (o *VpsContract) GetDataTrafficOk() (*DataTraffic, bool)` + +GetDataTrafficOk returns a tuple with the DataTraffic field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDataTraffic + +`func (o *VpsContract) SetDataTraffic(v DataTraffic)` + +SetDataTraffic sets DataTraffic field to given value. + + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/publiccloud/docs/VpsDetails.md b/publiccloud/docs/VpsDetails.md index c803f65..847cd5c 100644 --- a/publiccloud/docs/VpsDetails.md +++ b/publiccloud/docs/VpsDetails.md @@ -6,7 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **string** | | **Pack** | [**VpsPackType**](VpsPackType.md) | | -**Resources** | [**BaseResources**](BaseResources.md) | | **Region** | [**RegionName**](RegionName.md) | | **Datacenter** | [**Datacenter**](Datacenter.md) | | **Reference** | **string** | The identifying name set to the instance | @@ -16,15 +15,16 @@ Name | Type | Description | Notes **HasPublicIpV4** | **bool** | | **RootDiskSize** | **int32** | The root disk's size in GB. Must be at least 5 GB for Linux and FreeBSD instances and 50 GB for Windows instances | **StartedAt** | **NullableTime** | Date and time when the VPS was started for the first time, right after launching it | -**Contract** | [**VpsContract**](VpsContract.md) | | **Iso** | Pointer to [**NullableIso**](Iso.md) | | [optional] **Ips** | [**[]IpDetails**](IpDetails.md) | | +**Resources** | [**BaseResources**](BaseResources.md) | | +**Contract** | [**VpsContract**](VpsContract.md) | | ## Methods ### NewVpsDetails -`func NewVpsDetails(id string, pack VpsPackType, resources BaseResources, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime, contract VpsContract, ips []IpDetails, ) *VpsDetails` +`func NewVpsDetails(id string, pack VpsPackType, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime, ips []IpDetails, resources BaseResources, contract VpsContract, ) *VpsDetails` NewVpsDetails instantiates a new VpsDetails object This constructor will assign default values to properties that have it defined, @@ -79,26 +79,6 @@ and a boolean to check if the value has been set. SetPack sets Pack field to given value. -### GetResources - -`func (o *VpsDetails) GetResources() BaseResources` - -GetResources returns the Resources field if non-nil, zero value otherwise. - -### GetResourcesOk - -`func (o *VpsDetails) GetResourcesOk() (*BaseResources, bool)` - -GetResourcesOk returns a tuple with the Resources field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetResources - -`func (o *VpsDetails) SetResources(v BaseResources)` - -SetResources sets Resources field to given value. - - ### GetRegion `func (o *VpsDetails) GetRegion() RegionName` @@ -294,26 +274,6 @@ SetStartedAt sets StartedAt field to given value. `func (o *VpsDetails) UnsetStartedAt()` UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil -### GetContract - -`func (o *VpsDetails) GetContract() VpsContract` - -GetContract returns the Contract field if non-nil, zero value otherwise. - -### GetContractOk - -`func (o *VpsDetails) GetContractOk() (*VpsContract, bool)` - -GetContractOk returns a tuple with the Contract field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetContract - -`func (o *VpsDetails) SetContract(v VpsContract)` - -SetContract sets Contract field to given value. - - ### GetIso `func (o *VpsDetails) GetIso() Iso` @@ -369,6 +329,46 @@ and a boolean to check if the value has been set. SetIps sets Ips field to given value. +### GetResources + +`func (o *VpsDetails) GetResources() BaseResources` + +GetResources returns the Resources field if non-nil, zero value otherwise. + +### GetResourcesOk + +`func (o *VpsDetails) GetResourcesOk() (*BaseResources, bool)` + +GetResourcesOk returns a tuple with the Resources field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetResources + +`func (o *VpsDetails) SetResources(v BaseResources)` + +SetResources sets Resources field to given value. + + +### GetContract + +`func (o *VpsDetails) GetContract() VpsContract` + +GetContract returns the Contract field if non-nil, zero value otherwise. + +### GetContractOk + +`func (o *VpsDetails) GetContractOk() (*VpsContract, bool)` + +GetContractOk returns a tuple with the Contract field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetContract + +`func (o *VpsDetails) SetContract(v VpsContract)` + +SetContract sets Contract field to given value. + + [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/publiccloud/docs/VpsList.md b/publiccloud/docs/VpsList.md index 81637b4..873cf7d 100644 --- a/publiccloud/docs/VpsList.md +++ b/publiccloud/docs/VpsList.md @@ -6,7 +6,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **string** | | **Pack** | [**VpsPackType**](VpsPackType.md) | | -**Resources** | [**BaseResources**](BaseResources.md) | | **Region** | [**RegionName**](RegionName.md) | | **Datacenter** | [**Datacenter**](Datacenter.md) | | **Reference** | **string** | The identifying name set to the instance | @@ -16,14 +15,13 @@ Name | Type | Description | Notes **HasPublicIpV4** | **bool** | | **RootDiskSize** | **int32** | The root disk's size in GB. Must be at least 5 GB for Linux and FreeBSD instances and 50 GB for Windows instances | **StartedAt** | **NullableTime** | Date and time when the VPS was started for the first time, right after launching it | -**Contract** | [**VpsContract**](VpsContract.md) | | **Ips** | [**[]Ip**](Ip.md) | | ## Methods ### NewVpsList -`func NewVpsList(id string, pack VpsPackType, resources BaseResources, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime, contract VpsContract, ips []Ip, ) *VpsList` +`func NewVpsList(id string, pack VpsPackType, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime, ips []Ip, ) *VpsList` NewVpsList instantiates a new VpsList object This constructor will assign default values to properties that have it defined, @@ -78,26 +76,6 @@ and a boolean to check if the value has been set. SetPack sets Pack field to given value. -### GetResources - -`func (o *VpsList) GetResources() BaseResources` - -GetResources returns the Resources field if non-nil, zero value otherwise. - -### GetResourcesOk - -`func (o *VpsList) GetResourcesOk() (*BaseResources, bool)` - -GetResourcesOk returns a tuple with the Resources field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetResources - -`func (o *VpsList) SetResources(v BaseResources)` - -SetResources sets Resources field to given value. - - ### GetRegion `func (o *VpsList) GetRegion() RegionName` @@ -293,26 +271,6 @@ SetStartedAt sets StartedAt field to given value. `func (o *VpsList) UnsetStartedAt()` UnsetStartedAt ensures that no value is present for StartedAt, not even an explicit nil -### GetContract - -`func (o *VpsList) GetContract() VpsContract` - -GetContract returns the Contract field if non-nil, zero value otherwise. - -### GetContractOk - -`func (o *VpsList) GetContractOk() (*VpsContract, bool)` - -GetContractOk returns a tuple with the Contract field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetContract - -`func (o *VpsList) SetContract(v VpsContract)` - -SetContract sets Contract field to given value. - - ### GetIps `func (o *VpsList) GetIps() []Ip` diff --git a/publiccloud/model_data_traffic.go b/publiccloud/model_data_traffic.go new file mode 100644 index 0000000..3041874 --- /dev/null +++ b/publiccloud/model_data_traffic.go @@ -0,0 +1,192 @@ +/* +LeaseWeb API for launching and managing Public Cloud instances + +> The base URL for this API is: **https://api.leaseweb.com/publicCloud/v1/_** This API provides ways to launch and manage Public Cloud instances.
BETA
This API is in BETA. Documentation might be incorrect or incomplete. Functionality might change with the final release.> + +API version: v1 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package publiccloud + +import ( + "encoding/json" +) + +// checks if the DataTraffic type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DataTraffic{} + +// DataTraffic Data traffic commitment +type DataTraffic struct { + Value *float32 `json:"value,omitempty"` + Unit *string `json:"unit,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _DataTraffic DataTraffic + +// NewDataTraffic instantiates a new DataTraffic object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDataTraffic() *DataTraffic { + this := DataTraffic{} + return &this +} + +// NewDataTrafficWithDefaults instantiates a new DataTraffic object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDataTrafficWithDefaults() *DataTraffic { + this := DataTraffic{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *DataTraffic) GetValue() float32 { + if o == nil || IsNil(o.Value) { + var ret float32 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataTraffic) GetValueOk() (*float32, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *DataTraffic) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given float32 and assigns it to the Value field. +func (o *DataTraffic) SetValue(v float32) { + o.Value = &v +} + +// GetUnit returns the Unit field value if set, zero value otherwise. +func (o *DataTraffic) GetUnit() string { + if o == nil || IsNil(o.Unit) { + var ret string + return ret + } + return *o.Unit +} + +// GetUnitOk returns a tuple with the Unit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DataTraffic) GetUnitOk() (*string, bool) { + if o == nil || IsNil(o.Unit) { + return nil, false + } + return o.Unit, true +} + +// HasUnit returns a boolean if a field has been set. +func (o *DataTraffic) HasUnit() bool { + if o != nil && !IsNil(o.Unit) { + return true + } + + return false +} + +// SetUnit gets a reference to the given string and assigns it to the Unit field. +func (o *DataTraffic) SetUnit(v string) { + o.Unit = &v +} + +func (o DataTraffic) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DataTraffic) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.Unit) { + toSerialize["unit"] = o.Unit + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *DataTraffic) UnmarshalJSON(data []byte) (err error) { + varDataTraffic := _DataTraffic{} + + err = json.Unmarshal(data, &varDataTraffic) + + if err != nil { + return err + } + + *o = DataTraffic(varDataTraffic) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "value") + delete(additionalProperties, "unit") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableDataTraffic struct { + value *DataTraffic + isSet bool +} + +func (v NullableDataTraffic) Get() *DataTraffic { + return v.value +} + +func (v *NullableDataTraffic) Set(val *DataTraffic) { + v.value = val + v.isSet = true +} + +func (v NullableDataTraffic) IsSet() bool { + return v.isSet +} + +func (v *NullableDataTraffic) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDataTraffic(val *DataTraffic) *NullableDataTraffic { + return &NullableDataTraffic{value: val, isSet: true} +} + +func (v NullableDataTraffic) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDataTraffic) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/publiccloud/model_get_console_access_to_instance_result.go b/publiccloud/model_get_console_access_result.go similarity index 51% rename from publiccloud/model_get_console_access_to_instance_result.go rename to publiccloud/model_get_console_access_result.go index 3b56961..e47aa10 100644 --- a/publiccloud/model_get_console_access_to_instance_result.go +++ b/publiccloud/model_get_console_access_result.go @@ -14,37 +14,37 @@ import ( "encoding/json" ) -// checks if the GetConsoleAccessToInstanceResult type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &GetConsoleAccessToInstanceResult{} +// checks if the GetConsoleAccessResult type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetConsoleAccessResult{} -// GetConsoleAccessToInstanceResult struct for GetConsoleAccessToInstanceResult -type GetConsoleAccessToInstanceResult struct { +// GetConsoleAccessResult struct for GetConsoleAccessResult +type GetConsoleAccessResult struct { // The URL to the console Url *string `json:"url,omitempty"` AdditionalProperties map[string]interface{} } -type _GetConsoleAccessToInstanceResult GetConsoleAccessToInstanceResult +type _GetConsoleAccessResult GetConsoleAccessResult -// NewGetConsoleAccessToInstanceResult instantiates a new GetConsoleAccessToInstanceResult object +// NewGetConsoleAccessResult instantiates a new GetConsoleAccessResult object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewGetConsoleAccessToInstanceResult() *GetConsoleAccessToInstanceResult { - this := GetConsoleAccessToInstanceResult{} +func NewGetConsoleAccessResult() *GetConsoleAccessResult { + this := GetConsoleAccessResult{} return &this } -// NewGetConsoleAccessToInstanceResultWithDefaults instantiates a new GetConsoleAccessToInstanceResult object +// NewGetConsoleAccessResultWithDefaults instantiates a new GetConsoleAccessResult object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set -func NewGetConsoleAccessToInstanceResultWithDefaults() *GetConsoleAccessToInstanceResult { - this := GetConsoleAccessToInstanceResult{} +func NewGetConsoleAccessResultWithDefaults() *GetConsoleAccessResult { + this := GetConsoleAccessResult{} return &this } // GetUrl returns the Url field value if set, zero value otherwise. -func (o *GetConsoleAccessToInstanceResult) GetUrl() string { +func (o *GetConsoleAccessResult) GetUrl() string { if o == nil || IsNil(o.Url) { var ret string return ret @@ -54,7 +54,7 @@ func (o *GetConsoleAccessToInstanceResult) GetUrl() string { // GetUrlOk returns a tuple with the Url field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *GetConsoleAccessToInstanceResult) GetUrlOk() (*string, bool) { +func (o *GetConsoleAccessResult) GetUrlOk() (*string, bool) { if o == nil || IsNil(o.Url) { return nil, false } @@ -62,7 +62,7 @@ func (o *GetConsoleAccessToInstanceResult) GetUrlOk() (*string, bool) { } // HasUrl returns a boolean if a field has been set. -func (o *GetConsoleAccessToInstanceResult) HasUrl() bool { +func (o *GetConsoleAccessResult) HasUrl() bool { if o != nil && !IsNil(o.Url) { return true } @@ -71,11 +71,11 @@ func (o *GetConsoleAccessToInstanceResult) HasUrl() bool { } // SetUrl gets a reference to the given string and assigns it to the Url field. -func (o *GetConsoleAccessToInstanceResult) SetUrl(v string) { +func (o *GetConsoleAccessResult) SetUrl(v string) { o.Url = &v } -func (o GetConsoleAccessToInstanceResult) MarshalJSON() ([]byte, error) { +func (o GetConsoleAccessResult) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { return []byte{}, err @@ -83,7 +83,7 @@ func (o GetConsoleAccessToInstanceResult) MarshalJSON() ([]byte, error) { return json.Marshal(toSerialize) } -func (o GetConsoleAccessToInstanceResult) ToMap() (map[string]interface{}, error) { +func (o GetConsoleAccessResult) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.Url) { toSerialize["url"] = o.Url @@ -96,16 +96,16 @@ func (o GetConsoleAccessToInstanceResult) ToMap() (map[string]interface{}, error return toSerialize, nil } -func (o *GetConsoleAccessToInstanceResult) UnmarshalJSON(data []byte) (err error) { - varGetConsoleAccessToInstanceResult := _GetConsoleAccessToInstanceResult{} +func (o *GetConsoleAccessResult) UnmarshalJSON(data []byte) (err error) { + varGetConsoleAccessResult := _GetConsoleAccessResult{} - err = json.Unmarshal(data, &varGetConsoleAccessToInstanceResult) + err = json.Unmarshal(data, &varGetConsoleAccessResult) if err != nil { return err } - *o = GetConsoleAccessToInstanceResult(varGetConsoleAccessToInstanceResult) + *o = GetConsoleAccessResult(varGetConsoleAccessResult) additionalProperties := make(map[string]interface{}) @@ -117,38 +117,38 @@ func (o *GetConsoleAccessToInstanceResult) UnmarshalJSON(data []byte) (err error return err } -type NullableGetConsoleAccessToInstanceResult struct { - value *GetConsoleAccessToInstanceResult +type NullableGetConsoleAccessResult struct { + value *GetConsoleAccessResult isSet bool } -func (v NullableGetConsoleAccessToInstanceResult) Get() *GetConsoleAccessToInstanceResult { +func (v NullableGetConsoleAccessResult) Get() *GetConsoleAccessResult { return v.value } -func (v *NullableGetConsoleAccessToInstanceResult) Set(val *GetConsoleAccessToInstanceResult) { +func (v *NullableGetConsoleAccessResult) Set(val *GetConsoleAccessResult) { v.value = val v.isSet = true } -func (v NullableGetConsoleAccessToInstanceResult) IsSet() bool { +func (v NullableGetConsoleAccessResult) IsSet() bool { return v.isSet } -func (v *NullableGetConsoleAccessToInstanceResult) Unset() { +func (v *NullableGetConsoleAccessResult) Unset() { v.value = nil v.isSet = false } -func NewNullableGetConsoleAccessToInstanceResult(val *GetConsoleAccessToInstanceResult) *NullableGetConsoleAccessToInstanceResult { - return &NullableGetConsoleAccessToInstanceResult{value: val, isSet: true} +func NewNullableGetConsoleAccessResult(val *GetConsoleAccessResult) *NullableGetConsoleAccessResult { + return &NullableGetConsoleAccessResult{value: val, isSet: true} } -func (v NullableGetConsoleAccessToInstanceResult) MarshalJSON() ([]byte, error) { +func (v NullableGetConsoleAccessResult) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } -func (v *NullableGetConsoleAccessToInstanceResult) UnmarshalJSON(src []byte) error { +func (v *NullableGetConsoleAccessResult) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } diff --git a/publiccloud/model_vps_base.go b/publiccloud/model_vps_base.go index ac22496..9c4e2a5 100644 --- a/publiccloud/model_vps_base.go +++ b/publiccloud/model_vps_base.go @@ -23,7 +23,6 @@ var _ MappedNullable = &VpsBase{} type VpsBase struct { Id string `json:"id"` Pack VpsPackType `json:"pack"` - Resources BaseResources `json:"resources"` Region RegionName `json:"region"` Datacenter Datacenter `json:"datacenter"` // The identifying name set to the instance @@ -36,7 +35,6 @@ type VpsBase struct { RootDiskSize int32 `json:"rootDiskSize"` // Date and time when the VPS was started for the first time, right after launching it StartedAt NullableTime `json:"startedAt"` - Contract VpsContract `json:"contract"` AdditionalProperties map[string]interface{} } @@ -46,11 +44,10 @@ type _VpsBase VpsBase // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVpsBase(id string, pack VpsPackType, resources BaseResources, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime, contract VpsContract) *VpsBase { +func NewVpsBase(id string, pack VpsPackType, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime) *VpsBase { this := VpsBase{} this.Id = id this.Pack = pack - this.Resources = resources this.Region = region this.Datacenter = datacenter this.Reference = reference @@ -59,7 +56,6 @@ func NewVpsBase(id string, pack VpsPackType, resources BaseResources, region Reg this.HasPublicIpV4 = hasPublicIpV4 this.RootDiskSize = rootDiskSize this.StartedAt = startedAt - this.Contract = contract return &this } @@ -119,30 +115,6 @@ func (o *VpsBase) SetPack(v VpsPackType) { o.Pack = v } -// GetResources returns the Resources field value -func (o *VpsBase) GetResources() BaseResources { - if o == nil { - var ret BaseResources - return ret - } - - return o.Resources -} - -// GetResourcesOk returns a tuple with the Resources field value -// and a boolean to check if the value has been set. -func (o *VpsBase) GetResourcesOk() (*BaseResources, bool) { - if o == nil { - return nil, false - } - return &o.Resources, true -} - -// SetResources sets field value -func (o *VpsBase) SetResources(v BaseResources) { - o.Resources = v -} - // GetRegion returns the Region field value func (o *VpsBase) GetRegion() RegionName { if o == nil { @@ -379,30 +351,6 @@ func (o *VpsBase) SetStartedAt(v time.Time) { o.StartedAt.Set(&v) } -// GetContract returns the Contract field value -func (o *VpsBase) GetContract() VpsContract { - if o == nil { - var ret VpsContract - return ret - } - - return o.Contract -} - -// GetContractOk returns a tuple with the Contract field value -// and a boolean to check if the value has been set. -func (o *VpsBase) GetContractOk() (*VpsContract, bool) { - if o == nil { - return nil, false - } - return &o.Contract, true -} - -// SetContract sets field value -func (o *VpsBase) SetContract(v VpsContract) { - o.Contract = v -} - func (o VpsBase) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -415,7 +363,6 @@ func (o VpsBase) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["id"] = o.Id toSerialize["pack"] = o.Pack - toSerialize["resources"] = o.Resources toSerialize["region"] = o.Region toSerialize["datacenter"] = o.Datacenter toSerialize["reference"] = o.Reference @@ -427,7 +374,6 @@ func (o VpsBase) ToMap() (map[string]interface{}, error) { toSerialize["hasPublicIpV4"] = o.HasPublicIpV4 toSerialize["rootDiskSize"] = o.RootDiskSize toSerialize["startedAt"] = o.StartedAt.Get() - toSerialize["contract"] = o.Contract for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -443,7 +389,6 @@ func (o *VpsBase) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "id", "pack", - "resources", "region", "datacenter", "reference", @@ -452,7 +397,6 @@ func (o *VpsBase) UnmarshalJSON(data []byte) (err error) { "hasPublicIpV4", "rootDiskSize", "startedAt", - "contract", } allProperties := make(map[string]interface{}) @@ -484,7 +428,6 @@ func (o *VpsBase) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "id") delete(additionalProperties, "pack") - delete(additionalProperties, "resources") delete(additionalProperties, "region") delete(additionalProperties, "datacenter") delete(additionalProperties, "reference") @@ -494,7 +437,6 @@ func (o *VpsBase) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "hasPublicIpV4") delete(additionalProperties, "rootDiskSize") delete(additionalProperties, "startedAt") - delete(additionalProperties, "contract") o.AdditionalProperties = additionalProperties } diff --git a/publiccloud/model_vps_contract.go b/publiccloud/model_vps_contract.go index e05a6a4..b21cdea 100644 --- a/publiccloud/model_vps_contract.go +++ b/publiccloud/model_vps_contract.go @@ -32,6 +32,7 @@ type VpsContract struct { Sla string `json:"sla"` ControlPanel NullableString `json:"controlPanel"` InModification bool `json:"inModification"` + DataTraffic DataTraffic `json:"dataTraffic"` AdditionalProperties map[string]interface{} } @@ -41,7 +42,7 @@ type _VpsContract VpsContract // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVpsContract(billingFrequency BillingFrequency, term ContractTerm, type_ ContractType, endsAt NullableTime, createdAt time.Time, state ContractState, id string, sla string, controlPanel NullableString, inModification bool) *VpsContract { +func NewVpsContract(billingFrequency BillingFrequency, term ContractTerm, type_ ContractType, endsAt NullableTime, createdAt time.Time, state ContractState, id string, sla string, controlPanel NullableString, inModification bool, dataTraffic DataTraffic) *VpsContract { this := VpsContract{} this.BillingFrequency = billingFrequency this.Term = term @@ -53,6 +54,7 @@ func NewVpsContract(billingFrequency BillingFrequency, term ContractTerm, type_ this.Sla = sla this.ControlPanel = controlPanel this.InModification = inModification + this.DataTraffic = dataTraffic return &this } @@ -308,6 +310,30 @@ func (o *VpsContract) SetInModification(v bool) { o.InModification = v } +// GetDataTraffic returns the DataTraffic field value +func (o *VpsContract) GetDataTraffic() DataTraffic { + if o == nil { + var ret DataTraffic + return ret + } + + return o.DataTraffic +} + +// GetDataTrafficOk returns a tuple with the DataTraffic field value +// and a boolean to check if the value has been set. +func (o *VpsContract) GetDataTrafficOk() (*DataTraffic, bool) { + if o == nil { + return nil, false + } + return &o.DataTraffic, true +} + +// SetDataTraffic sets field value +func (o *VpsContract) SetDataTraffic(v DataTraffic) { + o.DataTraffic = v +} + func (o VpsContract) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -328,6 +354,7 @@ func (o VpsContract) ToMap() (map[string]interface{}, error) { toSerialize["sla"] = o.Sla toSerialize["controlPanel"] = o.ControlPanel.Get() toSerialize["inModification"] = o.InModification + toSerialize["dataTraffic"] = o.DataTraffic for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -351,6 +378,7 @@ func (o *VpsContract) UnmarshalJSON(data []byte) (err error) { "sla", "controlPanel", "inModification", + "dataTraffic", } allProperties := make(map[string]interface{}) @@ -390,6 +418,7 @@ func (o *VpsContract) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "sla") delete(additionalProperties, "controlPanel") delete(additionalProperties, "inModification") + delete(additionalProperties, "dataTraffic") o.AdditionalProperties = additionalProperties } diff --git a/publiccloud/model_vps_details.go b/publiccloud/model_vps_details.go index 91d8bf3..b58bdd8 100644 --- a/publiccloud/model_vps_details.go +++ b/publiccloud/model_vps_details.go @@ -23,7 +23,6 @@ var _ MappedNullable = &VpsDetails{} type VpsDetails struct { Id string `json:"id"` Pack VpsPackType `json:"pack"` - Resources BaseResources `json:"resources"` Region RegionName `json:"region"` Datacenter Datacenter `json:"datacenter"` // The identifying name set to the instance @@ -36,9 +35,10 @@ type VpsDetails struct { RootDiskSize int32 `json:"rootDiskSize"` // Date and time when the VPS was started for the first time, right after launching it StartedAt NullableTime `json:"startedAt"` - Contract VpsContract `json:"contract"` Iso NullableIso `json:"iso,omitempty"` Ips []IpDetails `json:"ips"` + Resources BaseResources `json:"resources"` + Contract VpsContract `json:"contract"` AdditionalProperties map[string]interface{} } @@ -48,11 +48,10 @@ type _VpsDetails VpsDetails // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVpsDetails(id string, pack VpsPackType, resources BaseResources, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime, contract VpsContract, ips []IpDetails) *VpsDetails { +func NewVpsDetails(id string, pack VpsPackType, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime, ips []IpDetails, resources BaseResources, contract VpsContract) *VpsDetails { this := VpsDetails{} this.Id = id this.Pack = pack - this.Resources = resources this.Region = region this.Datacenter = datacenter this.Reference = reference @@ -61,8 +60,9 @@ func NewVpsDetails(id string, pack VpsPackType, resources BaseResources, region this.HasPublicIpV4 = hasPublicIpV4 this.RootDiskSize = rootDiskSize this.StartedAt = startedAt - this.Contract = contract this.Ips = ips + this.Resources = resources + this.Contract = contract return &this } @@ -122,30 +122,6 @@ func (o *VpsDetails) SetPack(v VpsPackType) { o.Pack = v } -// GetResources returns the Resources field value -func (o *VpsDetails) GetResources() BaseResources { - if o == nil { - var ret BaseResources - return ret - } - - return o.Resources -} - -// GetResourcesOk returns a tuple with the Resources field value -// and a boolean to check if the value has been set. -func (o *VpsDetails) GetResourcesOk() (*BaseResources, bool) { - if o == nil { - return nil, false - } - return &o.Resources, true -} - -// SetResources sets field value -func (o *VpsDetails) SetResources(v BaseResources) { - o.Resources = v -} - // GetRegion returns the Region field value func (o *VpsDetails) GetRegion() RegionName { if o == nil { @@ -372,30 +348,6 @@ func (o *VpsDetails) SetStartedAt(v time.Time) { o.StartedAt.Set(&v) } -// GetContract returns the Contract field value -func (o *VpsDetails) GetContract() VpsContract { - if o == nil { - var ret VpsContract - return ret - } - - return o.Contract -} - -// GetContractOk returns a tuple with the Contract field value -// and a boolean to check if the value has been set. -func (o *VpsDetails) GetContractOk() (*VpsContract, bool) { - if o == nil { - return nil, false - } - return &o.Contract, true -} - -// SetContract sets field value -func (o *VpsDetails) SetContract(v VpsContract) { - o.Contract = v -} - // GetIso returns the Iso field value if set, zero value otherwise (both if not set or set to explicit null). func (o *VpsDetails) GetIso() Iso { if o == nil || IsNil(o.Iso.Get()) { @@ -462,6 +414,54 @@ func (o *VpsDetails) SetIps(v []IpDetails) { o.Ips = v } +// GetResources returns the Resources field value +func (o *VpsDetails) GetResources() BaseResources { + if o == nil { + var ret BaseResources + return ret + } + + return o.Resources +} + +// GetResourcesOk returns a tuple with the Resources field value +// and a boolean to check if the value has been set. +func (o *VpsDetails) GetResourcesOk() (*BaseResources, bool) { + if o == nil { + return nil, false + } + return &o.Resources, true +} + +// SetResources sets field value +func (o *VpsDetails) SetResources(v BaseResources) { + o.Resources = v +} + +// GetContract returns the Contract field value +func (o *VpsDetails) GetContract() VpsContract { + if o == nil { + var ret VpsContract + return ret + } + + return o.Contract +} + +// GetContractOk returns a tuple with the Contract field value +// and a boolean to check if the value has been set. +func (o *VpsDetails) GetContractOk() (*VpsContract, bool) { + if o == nil { + return nil, false + } + return &o.Contract, true +} + +// SetContract sets field value +func (o *VpsDetails) SetContract(v VpsContract) { + o.Contract = v +} + func (o VpsDetails) MarshalJSON() ([]byte, error) { toSerialize,err := o.ToMap() if err != nil { @@ -474,7 +474,6 @@ func (o VpsDetails) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["id"] = o.Id toSerialize["pack"] = o.Pack - toSerialize["resources"] = o.Resources toSerialize["region"] = o.Region toSerialize["datacenter"] = o.Datacenter toSerialize["reference"] = o.Reference @@ -486,11 +485,12 @@ func (o VpsDetails) ToMap() (map[string]interface{}, error) { toSerialize["hasPublicIpV4"] = o.HasPublicIpV4 toSerialize["rootDiskSize"] = o.RootDiskSize toSerialize["startedAt"] = o.StartedAt.Get() - toSerialize["contract"] = o.Contract if o.Iso.IsSet() { toSerialize["iso"] = o.Iso.Get() } toSerialize["ips"] = o.Ips + toSerialize["resources"] = o.Resources + toSerialize["contract"] = o.Contract for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -506,7 +506,6 @@ func (o *VpsDetails) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "id", "pack", - "resources", "region", "datacenter", "reference", @@ -515,8 +514,9 @@ func (o *VpsDetails) UnmarshalJSON(data []byte) (err error) { "hasPublicIpV4", "rootDiskSize", "startedAt", - "contract", "ips", + "resources", + "contract", } allProperties := make(map[string]interface{}) @@ -548,7 +548,6 @@ func (o *VpsDetails) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "id") delete(additionalProperties, "pack") - delete(additionalProperties, "resources") delete(additionalProperties, "region") delete(additionalProperties, "datacenter") delete(additionalProperties, "reference") @@ -558,9 +557,10 @@ func (o *VpsDetails) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "hasPublicIpV4") delete(additionalProperties, "rootDiskSize") delete(additionalProperties, "startedAt") - delete(additionalProperties, "contract") delete(additionalProperties, "iso") delete(additionalProperties, "ips") + delete(additionalProperties, "resources") + delete(additionalProperties, "contract") o.AdditionalProperties = additionalProperties } diff --git a/publiccloud/model_vps_list.go b/publiccloud/model_vps_list.go index 8408c65..cba7785 100644 --- a/publiccloud/model_vps_list.go +++ b/publiccloud/model_vps_list.go @@ -23,7 +23,6 @@ var _ MappedNullable = &VpsList{} type VpsList struct { Id string `json:"id"` Pack VpsPackType `json:"pack"` - Resources BaseResources `json:"resources"` Region RegionName `json:"region"` Datacenter Datacenter `json:"datacenter"` // The identifying name set to the instance @@ -36,7 +35,6 @@ type VpsList struct { RootDiskSize int32 `json:"rootDiskSize"` // Date and time when the VPS was started for the first time, right after launching it StartedAt NullableTime `json:"startedAt"` - Contract VpsContract `json:"contract"` Ips []Ip `json:"ips"` AdditionalProperties map[string]interface{} } @@ -47,11 +45,10 @@ type _VpsList VpsList // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewVpsList(id string, pack VpsPackType, resources BaseResources, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime, contract VpsContract, ips []Ip) *VpsList { +func NewVpsList(id string, pack VpsPackType, region RegionName, datacenter Datacenter, reference string, image Image, state VpsState, hasPublicIpV4 bool, rootDiskSize int32, startedAt NullableTime, ips []Ip) *VpsList { this := VpsList{} this.Id = id this.Pack = pack - this.Resources = resources this.Region = region this.Datacenter = datacenter this.Reference = reference @@ -60,7 +57,6 @@ func NewVpsList(id string, pack VpsPackType, resources BaseResources, region Reg this.HasPublicIpV4 = hasPublicIpV4 this.RootDiskSize = rootDiskSize this.StartedAt = startedAt - this.Contract = contract this.Ips = ips return &this } @@ -121,30 +117,6 @@ func (o *VpsList) SetPack(v VpsPackType) { o.Pack = v } -// GetResources returns the Resources field value -func (o *VpsList) GetResources() BaseResources { - if o == nil { - var ret BaseResources - return ret - } - - return o.Resources -} - -// GetResourcesOk returns a tuple with the Resources field value -// and a boolean to check if the value has been set. -func (o *VpsList) GetResourcesOk() (*BaseResources, bool) { - if o == nil { - return nil, false - } - return &o.Resources, true -} - -// SetResources sets field value -func (o *VpsList) SetResources(v BaseResources) { - o.Resources = v -} - // GetRegion returns the Region field value func (o *VpsList) GetRegion() RegionName { if o == nil { @@ -371,30 +343,6 @@ func (o *VpsList) SetStartedAt(v time.Time) { o.StartedAt.Set(&v) } -// GetContract returns the Contract field value -func (o *VpsList) GetContract() VpsContract { - if o == nil { - var ret VpsContract - return ret - } - - return o.Contract -} - -// GetContractOk returns a tuple with the Contract field value -// and a boolean to check if the value has been set. -func (o *VpsList) GetContractOk() (*VpsContract, bool) { - if o == nil { - return nil, false - } - return &o.Contract, true -} - -// SetContract sets field value -func (o *VpsList) SetContract(v VpsContract) { - o.Contract = v -} - // GetIps returns the Ips field value func (o *VpsList) GetIps() []Ip { if o == nil { @@ -431,7 +379,6 @@ func (o VpsList) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["id"] = o.Id toSerialize["pack"] = o.Pack - toSerialize["resources"] = o.Resources toSerialize["region"] = o.Region toSerialize["datacenter"] = o.Datacenter toSerialize["reference"] = o.Reference @@ -443,7 +390,6 @@ func (o VpsList) ToMap() (map[string]interface{}, error) { toSerialize["hasPublicIpV4"] = o.HasPublicIpV4 toSerialize["rootDiskSize"] = o.RootDiskSize toSerialize["startedAt"] = o.StartedAt.Get() - toSerialize["contract"] = o.Contract toSerialize["ips"] = o.Ips for key, value := range o.AdditionalProperties { @@ -460,7 +406,6 @@ func (o *VpsList) UnmarshalJSON(data []byte) (err error) { requiredProperties := []string{ "id", "pack", - "resources", "region", "datacenter", "reference", @@ -469,7 +414,6 @@ func (o *VpsList) UnmarshalJSON(data []byte) (err error) { "hasPublicIpV4", "rootDiskSize", "startedAt", - "contract", "ips", } @@ -502,7 +446,6 @@ func (o *VpsList) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "id") delete(additionalProperties, "pack") - delete(additionalProperties, "resources") delete(additionalProperties, "region") delete(additionalProperties, "datacenter") delete(additionalProperties, "reference") @@ -512,7 +455,6 @@ func (o *VpsList) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "hasPublicIpV4") delete(additionalProperties, "rootDiskSize") delete(additionalProperties, "startedAt") - delete(additionalProperties, "contract") delete(additionalProperties, "ips") o.AdditionalProperties = additionalProperties } diff --git a/publiccloud/test/api_publiccloud_test.go b/publiccloud/test/api_publiccloud_test.go index 3de3529..f66a392 100644 --- a/publiccloud/test/api_publiccloud_test.go +++ b/publiccloud/test/api_publiccloud_test.go @@ -98,29 +98,29 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) - t.Run("Test PubliccloudAPIService CreateLoadBalancerListener", func(t *testing.T) { + t.Run("Test PubliccloudAPIService CreateInstanceSnapshot", func(t *testing.T) { t.Skip("skip test") // remove to run test - var loadBalancerId string + var instanceId string - resp, httpRes, err := apiClient.PubliccloudAPI.CreateLoadBalancerListener(context.Background(), loadBalancerId).Execute() + httpRes, err := apiClient.PubliccloudAPI.CreateInstanceSnapshot(context.Background(), instanceId).Execute() require.Nil(t, err) - require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) - t.Run("Test PubliccloudAPIService CreateSnapshot", func(t *testing.T) { + t.Run("Test PubliccloudAPIService CreateLoadBalancerListener", func(t *testing.T) { t.Skip("skip test") // remove to run test - var instanceId string + var loadBalancerId string - httpRes, err := apiClient.PubliccloudAPI.CreateSnapshot(context.Background(), instanceId).Execute() + resp, httpRes, err := apiClient.PubliccloudAPI.CreateLoadBalancerListener(context.Background(), loadBalancerId).Execute() require.Nil(t, err) + require.NotNil(t, resp) assert.Equal(t, 200, httpRes.StatusCode) }) @@ -137,6 +137,19 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) + t.Run("Test PubliccloudAPIService CreateVPSSnapshot", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var vpsId string + + httpRes, err := apiClient.PubliccloudAPI.CreateVPSSnapshot(context.Background(), vpsId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test PubliccloudAPIService DeleteAutoScalingGroup", func(t *testing.T) { t.Skip("skip test") // remove to run test @@ -178,28 +191,28 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) - t.Run("Test PubliccloudAPIService DeleteLoadBalancerListener", func(t *testing.T) { + t.Run("Test PubliccloudAPIService DeleteInstanceSnapshot", func(t *testing.T) { t.Skip("skip test") // remove to run test - var loadBalancerId string - var listenerId string + var instanceId string + var snapshotId string - httpRes, err := apiClient.PubliccloudAPI.DeleteLoadBalancerListener(context.Background(), loadBalancerId, listenerId).Execute() + httpRes, err := apiClient.PubliccloudAPI.DeleteInstanceSnapshot(context.Background(), instanceId, snapshotId).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) }) - t.Run("Test PubliccloudAPIService DeleteSnapshot", func(t *testing.T) { + t.Run("Test PubliccloudAPIService DeleteLoadBalancerListener", func(t *testing.T) { t.Skip("skip test") // remove to run test - var instanceId string - var snapshotId string + var loadBalancerId string + var listenerId string - httpRes, err := apiClient.PubliccloudAPI.DeleteSnapshot(context.Background(), instanceId, snapshotId).Execute() + httpRes, err := apiClient.PubliccloudAPI.DeleteLoadBalancerListener(context.Background(), loadBalancerId, listenerId).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode) @@ -247,6 +260,20 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) + t.Run("Test PubliccloudAPIService DeleteVPSSnapshot", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var vpsId string + var snapshotId string + + httpRes, err := apiClient.PubliccloudAPI.DeleteVPSSnapshot(context.Background(), vpsId, snapshotId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test PubliccloudAPIService DeregisterAutoScalingGroupTargetGroup", func(t *testing.T) { t.Skip("skip test") // remove to run test @@ -368,20 +395,6 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) - t.Run("Test PubliccloudAPIService GetConsoleAccessToInstance", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - var instanceId string - - resp, httpRes, err := apiClient.PubliccloudAPI.GetConsoleAccessToInstance(context.Background(), instanceId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - t.Run("Test PubliccloudAPIService GetCpuMetrics", func(t *testing.T) { t.Skip("skip test") // remove to run test @@ -464,6 +477,20 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) + t.Run("Test PubliccloudAPIService GetInstanceConsoleAccess", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var instanceId string + + resp, httpRes, err := apiClient.PubliccloudAPI.GetInstanceConsoleAccess(context.Background(), instanceId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test PubliccloudAPIService GetInstanceCredential", func(t *testing.T) { t.Skip("skip test") // remove to run test @@ -564,6 +591,35 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) + t.Run("Test PubliccloudAPIService GetInstanceSnapshot", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var instanceId string + var snapshotId string + + resp, httpRes, err := apiClient.PubliccloudAPI.GetInstanceSnapshot(context.Background(), instanceId, snapshotId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PubliccloudAPIService GetInstanceSnapshotList", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var instanceId string + + resp, httpRes, err := apiClient.PubliccloudAPI.GetInstanceSnapshotList(context.Background(), instanceId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test PubliccloudAPIService GetInstanceTypeList", func(t *testing.T) { t.Skip("skip test") // remove to run test @@ -794,14 +850,13 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) - t.Run("Test PubliccloudAPIService GetSnapshot", func(t *testing.T) { + t.Run("Test PubliccloudAPIService GetTargetGroup", func(t *testing.T) { t.Skip("skip test") // remove to run test - var instanceId string - var snapshotId string + var targetGroupId string - resp, httpRes, err := apiClient.PubliccloudAPI.GetSnapshot(context.Background(), instanceId, snapshotId).Execute() + resp, httpRes, err := apiClient.PubliccloudAPI.GetTargetGroup(context.Background(), targetGroupId).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -809,13 +864,11 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) - t.Run("Test PubliccloudAPIService GetSnapshotList", func(t *testing.T) { + t.Run("Test PubliccloudAPIService GetTargetGroupList", func(t *testing.T) { t.Skip("skip test") // remove to run test - var instanceId string - - resp, httpRes, err := apiClient.PubliccloudAPI.GetSnapshotList(context.Background(), instanceId).Execute() + resp, httpRes, err := apiClient.PubliccloudAPI.GetTargetGroupList(context.Background()).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -823,25 +876,13 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) - t.Run("Test PubliccloudAPIService GetTargetGroup", func(t *testing.T) { + t.Run("Test PubliccloudAPIService GetTargetList", func(t *testing.T) { t.Skip("skip test") // remove to run test var targetGroupId string - resp, httpRes, err := apiClient.PubliccloudAPI.GetTargetGroup(context.Background(), targetGroupId).Execute() - - require.Nil(t, err) - require.NotNil(t, resp) - assert.Equal(t, 200, httpRes.StatusCode) - - }) - - t.Run("Test PubliccloudAPIService GetTargetGroupList", func(t *testing.T) { - - t.Skip("skip test") // remove to run test - - resp, httpRes, err := apiClient.PubliccloudAPI.GetTargetGroupList(context.Background()).Execute() + resp, httpRes, err := apiClient.PubliccloudAPI.GetTargetList(context.Background(), targetGroupId).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -849,13 +890,13 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) - t.Run("Test PubliccloudAPIService GetTargetList", func(t *testing.T) { + t.Run("Test PubliccloudAPIService GetUpdateInstanceTypeList", func(t *testing.T) { t.Skip("skip test") // remove to run test - var targetGroupId string + var instanceId string - resp, httpRes, err := apiClient.PubliccloudAPI.GetTargetList(context.Background(), targetGroupId).Execute() + resp, httpRes, err := apiClient.PubliccloudAPI.GetUpdateInstanceTypeList(context.Background(), instanceId).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -863,13 +904,13 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) - t.Run("Test PubliccloudAPIService GetUpdateInstanceTypeList", func(t *testing.T) { + t.Run("Test PubliccloudAPIService GetVPSConsoleAccess", func(t *testing.T) { t.Skip("skip test") // remove to run test - var instanceId string + var vpsId string - resp, httpRes, err := apiClient.PubliccloudAPI.GetUpdateInstanceTypeList(context.Background(), instanceId).Execute() + resp, httpRes, err := apiClient.PubliccloudAPI.GetVPSConsoleAccess(context.Background(), vpsId).Execute() require.Nil(t, err) require.NotNil(t, resp) @@ -965,6 +1006,35 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) + t.Run("Test PubliccloudAPIService GetVPSSnapshot", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var vpsId string + var snapshotId string + + resp, httpRes, err := apiClient.PubliccloudAPI.GetVPSSnapshot(context.Background(), vpsId, snapshotId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PubliccloudAPIService GetVPSSnapshotList", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var vpsId string + + resp, httpRes, err := apiClient.PubliccloudAPI.GetVPSSnapshotList(context.Background(), vpsId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + t.Run("Test PubliccloudAPIService GetVps", func(t *testing.T) { t.Skip("skip test") // remove to run test @@ -1236,14 +1306,28 @@ func Test_publiccloud_PubliccloudAPIService(t *testing.T) { }) - t.Run("Test PubliccloudAPIService RestoreSnapshot", func(t *testing.T) { + t.Run("Test PubliccloudAPIService RestoreInstanceSnapshot", func(t *testing.T) { t.Skip("skip test") // remove to run test var instanceId string var snapshotId string - httpRes, err := apiClient.PubliccloudAPI.RestoreSnapshot(context.Background(), instanceId, snapshotId).Execute() + httpRes, err := apiClient.PubliccloudAPI.RestoreInstanceSnapshot(context.Background(), instanceId, snapshotId).Execute() + + require.Nil(t, err) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test PubliccloudAPIService RestoreVPSSnapshot", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var vpsId string + var snapshotId string + + httpRes, err := apiClient.PubliccloudAPI.RestoreVPSSnapshot(context.Background(), vpsId, snapshotId).Execute() require.Nil(t, err) assert.Equal(t, 200, httpRes.StatusCode)