# README
Genesis Cloud Go Client
The Genesis Cloud Go client provides the ability to manage each services resources programmatically from scripts or applications.
This repository is licensed under Mozilla Public License 2.0 (no copyleft exception) (see LICENSE.txt).
Maintainers
This client is maintained by Genesis Cloud. If you encounter any problems, feel free to create issues or pull requests.
Requirements
- Go >= 1.19
Installation
go get github.com/genesiscloud/genesiscloud-go
Getting Started
import "github.com/genesiscloud/genesiscloud-go"
// Generic pointer in Go 1.18+. Alternatively use "k8s.io/utils/pointer"
func pointer[T any](v T) *T {
return &v
}
client, err := genesiscloud.NewGenesisCloudClient(genesiscloud.ClientConfig{
Token: os.Getenv("GENESISCLOUD_TOKEN"),
})
if err != nil {
// ...
}
resp, err := client.ListInstancesWithResponse(ctx, &genesiscloud.ListInstancesParams{
Page: pointer(1),
PerPage: pointer(100),
})
if err != nil {
// ...
}
Examples
You can find additional examples in the GoDoc or check the examples folder.
GENESISCLOUD_TOKEN="XXXX" go run ./examples/list-instances
Development or update of OpenAPI document
# Update openapi.yaml (./codegen/openapi.yaml)
# Generate code
go generate ./...
# Functions
Creates a new Client, with reasonable defaults.
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling.
NewCreateFilesystemRequest calls the generic CreateFilesystem builder with application/json body.
NewCreateFilesystemRequestWithBody generates requests for CreateFilesystem with any type of body.
NewCreateFloatingIPRequest calls the generic CreateFloatingIP builder with application/json body.
NewCreateFloatingIPRequestWithBody generates requests for CreateFloatingIP with any type of body.
NewCreateInstanceRequest calls the generic CreateInstance builder with application/json body.
NewCreateInstanceRequestWithBody generates requests for CreateInstance with any type of body.
NewCreateInstanceSnapshotRequest calls the generic CreateInstanceSnapshot builder with application/json body.
NewCreateInstanceSnapshotRequestWithBody generates requests for CreateInstanceSnapshot with any type of body.
NewCreateSecurityGroupRequest calls the generic CreateSecurityGroup builder with application/json body.
NewCreateSecurityGroupRequestWithBody generates requests for CreateSecurityGroup with any type of body.
NewCreateSnapshotRequest calls the generic CreateSnapshot builder with application/json body.
NewCreateSnapshotRequestWithBody generates requests for CreateSnapshot with any type of body.
NewCreateSSHKeyRequest calls the generic CreateSSHKey builder with application/json body.
NewCreateSSHKeyRequestWithBody generates requests for CreateSSHKey with any type of body.
NewCreateVolumeRequest calls the generic CreateVolume builder with application/json body.
NewCreateVolumeRequestWithBody generates requests for CreateVolume with any type of body.
NewDeleteFilesystemRequest generates requests for DeleteFilesystem.
NewDeleteFloatingIPRequest generates requests for DeleteFloatingIP.
NewDeleteInstanceRequest generates requests for DeleteInstance.
NewDeleteSecurityGroupRequest generates requests for DeleteSecurityGroup.
NewDeleteSnapshotRequest generates requests for DeleteSnapshot.
NewDeleteSSHKeyRequest generates requests for DeleteSSHKey.
NewDeleteVolumeRequest generates requests for DeleteVolume.
No description provided by the author
NewGetFilesystemRequest generates requests for GetFilesystem.
NewGetFloatingIPRequest generates requests for GetFloatingIP.
NewGetInstanceRequest generates requests for GetInstance.
NewGetInstancesAvailabilityRequest generates requests for GetInstancesAvailability.
NewGetInstanceUserMetadataRequest generates requests for GetInstanceUserMetadata.
NewGetSecurityGroupRequest generates requests for GetSecurityGroup.
NewGetSnapshotRequest generates requests for GetSnapshot.
NewGetSSHKeyRequest generates requests for GetSSHKey.
NewGetVolumeRequest generates requests for GetVolume.
NewListCatalogRequest generates requests for ListCatalog.
NewListFilesystemsRequest generates requests for ListFilesystems.
NewListFloatingIPsRequest generates requests for ListFloatingIPs.
NewListImagesRequest generates requests for ListImages.
NewListInstanceActionsRequest generates requests for ListInstanceActions.
NewListInstanceSnapshotsRequest generates requests for ListInstanceSnapshots.
NewListInstancesRequest generates requests for ListInstances.
NewListSecurityGroupsRequest generates requests for ListSecurityGroups.
NewListSnapshotsRequest generates requests for ListSnapshots.
NewListSSHKeysRequest generates requests for ListSSHKeys.
NewListVolumesRequest generates requests for ListVolumes.
NewPerformInstanceActionRequest calls the generic PerformInstanceAction builder with application/json body.
NewPerformInstanceActionRequestWithBody generates requests for PerformInstanceAction with any type of body.
NewUpdateFilesystemRequest calls the generic UpdateFilesystem builder with application/json body.
NewUpdateFilesystemRequestWithBody generates requests for UpdateFilesystem with any type of body.
NewUpdateFloatingIPRequest calls the generic UpdateFloatingIP builder with application/json body.
NewUpdateFloatingIPRequestWithBody generates requests for UpdateFloatingIP with any type of body.
NewUpdateInstanceRequest calls the generic UpdateInstance builder with application/json body.
NewUpdateInstanceRequestWithBody generates requests for UpdateInstance with any type of body.
NewUpdateSecurityGroupRequest calls the generic UpdateSecurityGroup builder with application/json body.
NewUpdateSecurityGroupRequestWithBody generates requests for UpdateSecurityGroup with any type of body.
NewUpdateSnapshotRequest calls the generic UpdateSnapshot builder with application/json body.
NewUpdateSnapshotRequestWithBody generates requests for UpdateSnapshot with any type of body.
NewUpdateSSHKeyRequest calls the generic UpdateSSHKey builder with application/json body.
NewUpdateSSHKeyRequestWithBody generates requests for UpdateSSHKey with any type of body.
NewUpdateVolumeRequest calls the generic UpdateVolume builder with application/json body.
NewUpdateVolumeRequestWithBody generates requests for UpdateVolume with any type of body.
ParseCreateFilesystemResponse parses an HTTP response from a CreateFilesystemWithResponse call.
ParseCreateFloatingIPResponse parses an HTTP response from a CreateFloatingIPWithResponse call.
ParseCreateInstanceResponse parses an HTTP response from a CreateInstanceWithResponse call.
ParseCreateInstanceSnapshotResponse parses an HTTP response from a CreateInstanceSnapshotWithResponse call.
ParseCreateSecurityGroupResponse parses an HTTP response from a CreateSecurityGroupWithResponse call.
ParseCreateSnapshotResponse parses an HTTP response from a CreateSnapshotWithResponse call.
ParseCreateSSHKeyResponse parses an HTTP response from a CreateSSHKeyWithResponse call.
ParseCreateVolumeResponse parses an HTTP response from a CreateVolumeWithResponse call.
ParseDeleteFilesystemResponse parses an HTTP response from a DeleteFilesystemWithResponse call.
ParseDeleteFloatingIPResponse parses an HTTP response from a DeleteFloatingIPWithResponse call.
ParseDeleteInstanceResponse parses an HTTP response from a DeleteInstanceWithResponse call.
ParseDeleteSecurityGroupResponse parses an HTTP response from a DeleteSecurityGroupWithResponse call.
ParseDeleteSnapshotResponse parses an HTTP response from a DeleteSnapshotWithResponse call.
ParseDeleteSSHKeyResponse parses an HTTP response from a DeleteSSHKeyWithResponse call.
ParseDeleteVolumeResponse parses an HTTP response from a DeleteVolumeWithResponse call.
ParseGetFilesystemResponse parses an HTTP response from a GetFilesystemWithResponse call.
ParseGetFloatingIPResponse parses an HTTP response from a GetFloatingIPWithResponse call.
ParseGetInstanceResponse parses an HTTP response from a GetInstanceWithResponse call.
ParseGetInstancesAvailabilityResponse parses an HTTP response from a GetInstancesAvailabilityWithResponse call.
ParseGetInstanceUserMetadataResponse parses an HTTP response from a GetInstanceUserMetadataWithResponse call.
ParseGetSecurityGroupResponse parses an HTTP response from a GetSecurityGroupWithResponse call.
ParseGetSnapshotResponse parses an HTTP response from a GetSnapshotWithResponse call.
ParseGetSSHKeyResponse parses an HTTP response from a GetSSHKeyWithResponse call.
ParseGetVolumeResponse parses an HTTP response from a GetVolumeWithResponse call.
ParseListCatalogResponse parses an HTTP response from a ListCatalogWithResponse call.
ParseListFilesystemsResponse parses an HTTP response from a ListFilesystemsWithResponse call.
ParseListFloatingIPsResponse parses an HTTP response from a ListFloatingIPsWithResponse call.
ParseListImagesResponse parses an HTTP response from a ListImagesWithResponse call.
ParseListInstanceActionsResponse parses an HTTP response from a ListInstanceActionsWithResponse call.
ParseListInstanceSnapshotsResponse parses an HTTP response from a ListInstanceSnapshotsWithResponse call.
ParseListInstancesResponse parses an HTTP response from a ListInstancesWithResponse call.
ParseListSecurityGroupsResponse parses an HTTP response from a ListSecurityGroupsWithResponse call.
ParseListSnapshotsResponse parses an HTTP response from a ListSnapshotsWithResponse call.
ParseListSSHKeysResponse parses an HTTP response from a ListSSHKeysWithResponse call.
ParseListVolumesResponse parses an HTTP response from a ListVolumesWithResponse call.
ParsePerformInstanceActionResponse parses an HTTP response from a PerformInstanceActionWithResponse call.
ParseUpdateFilesystemResponse parses an HTTP response from a UpdateFilesystemWithResponse call.
ParseUpdateFloatingIPResponse parses an HTTP response from a UpdateFloatingIPWithResponse call.
ParseUpdateInstanceResponse parses an HTTP response from a UpdateInstanceWithResponse call.
ParseUpdateSecurityGroupResponse parses an HTTP response from a UpdateSecurityGroupWithResponse call.
ParseUpdateSnapshotResponse parses an HTTP response from a UpdateSnapshotWithResponse call.
ParseUpdateSSHKeyResponse parses an HTTP response from a UpdateSSHKeyWithResponse call.
ParseUpdateVolumeResponse parses an HTTP response from a UpdateVolumeWithResponse call.
WithBaseURL overrides the baseURL.
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client.
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request.
# Constants
No description provided by the author
Defines values for CreateFloatingIPJSONBodyVersion.
No description provided by the author
Defines values for FilesystemStatus.
Defines values for FilesystemStatus.
Defines values for FilesystemStatus.
Defines values for FilesystemType.
Defines values for FloatingIpStatus.
Defines values for FloatingIpStatus.
Defines values for FloatingIpStatus.
Defines values for FloatingIpStatus.
Defines values for FloatingIPVersion.
Defines values for FloatingIPVersion.
Defines values for ImageType.
Defines values for ImageType.
Defines values for ImageType.
Defines values for ImageType.
Defines values for InstanceAction.
Defines values for InstanceAction.
Defines values for InstanceAction.
Defines values for InstanceBillingType.
Defines values for InstanceBillingType.
Defines values for InstanceBillingType.
Defines values for InstanceBillingType.
Defines values for InstanceBillingType.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for InstanceStatus.
Defines values for OSType.
Defines values for OSType.
Defines values for Region.
Defines values for Region.
Defines values for Region.
Defines values for SecurityGroupRuleDirection.
Defines values for SecurityGroupRuleDirection.
Defines values for SecurityGroupRuleProtocol.
Defines values for SecurityGroupRuleProtocol.
Defines values for SecurityGroupRuleProtocol.
Defines values for SecurityGroupRuleProtocol.
Defines values for SecurityGroupStatus.
Defines values for SecurityGroupStatus.
Defines values for SecurityGroupStatus.
Defines values for SecurityGroupStatus.
Defines values for SecurityGroupStatus.
Defines values for SnapshotStatus.
Defines values for SnapshotStatus.
Defines values for SnapshotStatus.
Defines values for SnapshotStatus.
Defines values for SnapshotStatus.
Defines values for SnapshotStatus.
Defines values for VolumeStatus.
Defines values for VolumeStatus.
Defines values for VolumeStatus.
Defines values for VolumeStatus.
Defines values for VolumeStatus.
Defines values for VolumeStatus.
Defines values for VolumeStatus.
Defines values for VolumeType.
Defines values for VolumeType.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
Catalog defines model for Catalog.
Client which conforms to the OpenAPI3 specification for this service.
No description provided by the author
ClientWithResponses builds on ClientInterface to offer response payloads.
CreateFilesystemJSONBody defines parameters for CreateFilesystem.
No description provided by the author
CreateFloatingIPJSONBody defines parameters for CreateFloatingIP.
No description provided by the author
CreateInstanceJSONBody defines parameters for CreateInstance.
No description provided by the author
CreateInstanceSnapshotJSONBody defines parameters for CreateInstanceSnapshot.
No description provided by the author
CreateSecurityGroupJSONBody defines parameters for CreateSecurityGroup.
No description provided by the author
CreateSnapshotJSONBody defines parameters for CreateSnapshot.
No description provided by the author
CreateSSHKeyJSONBody defines parameters for CreateSSHKey.
No description provided by the author
CreateVolumeJSONBody defines parameters for CreateVolume.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Error defines model for Error.
Filesystem defines model for Filesystem.
FloatingIP defines model for FloatingIP.
No description provided by the author
No description provided by the author
No description provided by the author
GetInstancesAvailabilityParams defines parameters for GetInstancesAvailability.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Image defines model for Image.
Instance defines model for Instance.
InstanceListActionsResponse defines model for Instance.ListActionsResponse.
InstancesAvailability defines model for InstancesAvailability.
InstanceUpdateSecurityGroups defines model for Instance.UpdateSecurityGroups.
InstanceUpdateSecurityGroupsAttach defines model for Instance.UpdateSecurityGroups.Attach.
InstanceUpdateSecurityGroupsDetach defines model for Instance.UpdateSecurityGroups.Detach.
InstanceUpdateVolumes defines model for Instance.UpdateVolumes.
InstanceUpdateVolumesAttach defines model for Instance.UpdateVolumes.Attach.
InstanceUpdateVolumesDetach defines model for Instance.UpdateVolumes.Detach.
ListCatalogParams defines parameters for ListCatalog.
No description provided by the author
ListFilesystemsParams defines parameters for ListFilesystems.
No description provided by the author
ListFloatingIPsParams defines parameters for ListFloatingIPs.
No description provided by the author
ListImagesParams defines parameters for ListImages.
No description provided by the author
No description provided by the author
ListInstanceSnapshotsParams defines parameters for ListInstanceSnapshots.
No description provided by the author
ListInstancesParams defines parameters for ListInstances.
No description provided by the author
ListSecurityGroupsParams defines parameters for ListSecurityGroups.
No description provided by the author
ListSnapshotsParams defines parameters for ListSnapshots.
No description provided by the author
ListSSHKeysParams defines parameters for ListSSHKeys.
No description provided by the author
ListVolumesParams defines parameters for ListVolumes.
No description provided by the author
PaginatedCatalogResponse defines model for PaginatedCatalogResponse.
PaginatedFilesystemsResponse defines model for PaginatedFilesystemsResponse.
PaginatedFloatingIPsResponse defines model for PaginatedFloatingIPsResponse.
PaginatedImagesResponse defines model for PaginatedImagesResponse.
PaginatedInstancesResponse defines model for PaginatedInstancesResponse.
PaginatedSecurityGroupsResponse defines model for PaginatedSecurityGroupsResponse.
PaginatedSnapshotsResponse defines model for PaginatedSnapshotsResponse.
PaginatedSSHKeysResponse defines model for PaginatedSSHKeysResponse.
PaginatedVolumesResponse defines model for PaginatedVolumesResponse.
PerformInstanceActionJSONBody defines parameters for PerformInstanceAction.
No description provided by the author
SecurityGroup defines model for SecurityGroup.
SecurityGroupRule defines model for SecurityGroup.Rule.
SingleFilesystemResponse defines model for SingleFilesystemResponse.
SingleFloatingIPResponse defines model for SingleFloatingIPResponse.
SingleInstanceResponse defines model for SingleInstanceResponse.
SingleSecurityGroupResponse defines model for SingleSecurityGroupResponse.
SingleSnapshotResponse defines model for SingleSnapshotResponse.
SingleVolumeResponse defines model for SingleVolumeResponse.
Snapshot defines model for Snapshot.
SSHKey defines model for SSHKey.
UpdateFilesystemJSONBody defines parameters for UpdateFilesystem.
No description provided by the author
UpdateFloatingIPJSONBody defines parameters for UpdateFloatingIP.
No description provided by the author
UpdateInstanceJSONBody defines parameters for UpdateInstance.
No description provided by the author
UpdateSecurityGroupJSONBody defines parameters for UpdateSecurityGroup.
No description provided by the author
UpdateSnapshotJSONBody defines parameters for UpdateSnapshot.
No description provided by the author
UpdateSSHKeyJSONBody defines parameters for UpdateSSHKey.
No description provided by the author
UpdateVolumeJSONBody defines parameters for UpdateVolume.
No description provided by the author
Volume defines model for Volume.
# Interfaces
The interface specification for the client above.
ClientWithResponsesInterface is the interface specification for the client with responses above.
Doer performs HTTP requests.
# Type aliases
CatalogFields defines model for Catalog.Fields.
ClientOption allows setting custom parameters during construction.
CreateFilesystemJSONRequestBody defines body for CreateFilesystem for application/json ContentType.
CreateFloatingIPJSONBodyVersion defines parameters for CreateFloatingIP.
CreateFloatingIPJSONRequestBody defines body for CreateFloatingIP for application/json ContentType.
CreateInstanceJSONRequestBody defines body for CreateInstance for application/json ContentType.
CreateInstanceSnapshotJSONRequestBody defines body for CreateInstanceSnapshot for application/json ContentType.
CreateSecurityGroupJSONRequestBody defines body for CreateSecurityGroup for application/json ContentType.
CreateSnapshotJSONRequestBody defines body for CreateSnapshot for application/json ContentType.
CreateSSHKeyJSONRequestBody defines body for CreateSSHKey for application/json ContentType.
CreateVolumeJSONRequestBody defines body for CreateVolume for application/json ContentType.
ErrorResponse defines model for ErrorResponse.
FilesystemId A unique identifier for each filesystem.
FilesystemStatus defines model for Filesystem.Status.
FilesystemType The filesystem type.
FloatingIpStatus The floating ip status.
FloatingIPVersion The IP version of the floating IP.
ImageId A unique number that can be used to identify and reference a specific image.
ImageType Describes the kind of image.
InstanceAction defines model for Instance.Action.
InstanceBillingType The billing type of the instance.
InstanceDestroyOnShutdown Option that you can set at instance creation that will allow the instance to destroy on shutdown command.
InstanceDiskSize The storage size of the instance's boot volume given in GiB.
InstanceDNSName The dns name of your instance.
InstanceFloatingIp The id of the floating IP to attach to the instance.
InstanceGetInstanceUserMetadataResponse defines model for Instance.GetInstanceUserMetadataResponse.
InstanceHostname The hostname of your instance.
InstanceIsProtected Specifies if the instance is termination protected.
InstanceName The human-readable name set for the instance.
InstancePublicIpv6 A boolean value indicating whether the instance should have an ipv6 address or not.
InstanceReuseLongTermSubscription The long term subscription id to be used for this instance.
InstancesAvailabilityResponse defines model for InstancesAvailabilityResponse.
InstanceSSHKeyId The ssh key ID.
InstanceStatus The instance status.
InstanceType The instance type identifier.
InstanceUpdateSecurityGroupsList The instance's security group IDs.
InstanceUpdateVolumesList The instance's volume IDs.
InstanceUserData defines model for Instance.UserData.
OSType The OS type.
PageQueryParameter A positive integer to choose the page to return.
PerformInstanceActionJSONRequestBody defines body for PerformInstanceAction for application/json ContentType.
PerPageQueryParameter A positive integer lower or equal to 100 to select the number of items to return.
Region The region identifier.
RequestEditorFn is the function signature for the RequestEditor callback function.
SecurityGroupId A unique identifier for each security group.
SecurityGroupRuleDirection The direction of the rule.
SecurityGroupRuleProtocol The protocol of the rule.
SecurityGroupStatus The security group status.
SingleSSHKeyResponse defines model for SingleSSHKeyResponse.
SnapshotStatus The snapshot status.
Timestamp defines model for Timestamp.
UpdateFilesystemJSONRequestBody defines body for UpdateFilesystem for application/json ContentType.
UpdateFloatingIPJSONRequestBody defines body for UpdateFloatingIP for application/json ContentType.
UpdateInstanceJSONRequestBody defines body for UpdateInstance for application/json ContentType.
UpdateSecurityGroupJSONRequestBody defines body for UpdateSecurityGroup for application/json ContentType.
UpdateSnapshotJSONRequestBody defines body for UpdateSnapshot for application/json ContentType.
UpdateSSHKeyJSONRequestBody defines body for UpdateSSHKey for application/json ContentType.
UpdateVolumeJSONRequestBody defines body for UpdateVolume for application/json ContentType.
VolumeId A unique identifier for each volume.
VolumeStatus defines model for Volume.Status.
VolumeType The volume type.