package
1.0.9
Repository: https://github.com/joshraker/aptible-api-go.git
Documentation: pkg.go.dev

# README

Go API client for aptibleapi

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: v1
  • Package version: 1.0.0
  • Generator version: 7.6.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

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

import aptibleapi "github.com/aptible/aptible-api-go/aptibleapi"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value aptibleapi.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), aptibleapi.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value aptibleapi.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), aptibleapi.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using aptibleapi.ContextOperationServerIndices and aptibleapi.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), aptibleapi.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), aptibleapi.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.aptible.com

ClassMethodHTTP requestDescription
AccountsAPICreateAccountPost /accountscreate account
AccountsAPIDeleteAccountDelete /accounts/{id}delete account
AccountsAPIGetAccountGet /accounts/{id}show account
AccountsAPIListAccountsGet /accountslist accounts
AccountsAPIListAccountsForStackGet /stacks/{stack_id}/accountslist accounts
AccountsAPIPatchAccountPatch /accounts/{id}update account
AccountsAPIUpdateAccountPut /accounts/{id}update account
ActivityReportsAPIGetActivityReportGet /activity_reports/{id}show activity_report
ActivityReportsAPIGetActivityReportDownloadGet /activity_reports/{activity_report_id}/downloaddownload activity_report
ActivityReportsAPIListActivityReportsForAccountGet /accounts/{account_id}/activity_reportslist activity_reports
AppsAPICreateAppPost /accounts/{account_id}/appscreate app
AppsAPIDeleteAppDelete /apps/{id}delete app
AppsAPIGetAppGet /apps/{id}show app
AppsAPIListAppsGet /appslist apps
AppsAPIListAppsForAccountGet /accounts/{account_id}/appslist apps
AppsAPIListAppsForCertificateGet /certificates/{certificate_id}/appslist apps
AppsAPIPatchAppPatch /apps/{id}update app
AppsAPIUpdateAppPut /apps/{id}update app
BackupRetentionPoliciesAPICreateBackupRetentionPolicyPost /accounts/{account_id}/backup_retention_policiescreate backup retention policy
BackupRetentionPoliciesAPIGetBackupRetentionPolicyGet /backup_retention_policies/{id}show backup_retention_policy
BackupRetentionPoliciesAPIListBackupRetentionPoliciesForAccountGet /accounts/{account_id}/backup_retention_policieslist backup retention policies
BackupsAPIGetBackupGet /backups/{id}show backup
BackupsAPIListBackupsForAccountGet /accounts/{account_id}/backupslist backups
BackupsAPIListBackupsForDatabaseGet /databases/{database_id}/backupslist backups
BackupsAPIListCopiesForBackupGet /backups/{backup_id}/copieslist backups
CertificatesAPICreateCertificatePost /accounts/{account_id}/certificatescreate certificate
CertificatesAPIDeleteCertificateDelete /certificates/{id}delete certificate
CertificatesAPIGetCertificateGet /certificates/{id}show certificate
CertificatesAPIListCertificatesForAccountGet /accounts/{account_id}/certificateslist certificates
CertificatesAPIPatchCertificatePatch /certificates/{id}update certificate
CertificatesAPIUpdateCertificatePut /certificates/{id}update certificate
ClaimsAPIClaimsTypePostPost /claims/{type}create claim
ClaimsAPICreateClaimPost /claimscreate claim
ClaimsAPICreateClaimForAccountPost /accounts/{account_id}/claims/{type}create claim
CodeScanResultsAPICreateCodeScanResultPost /apps/{app_id}/code_scan_resultscreate code_scan_result
CodeScanResultsAPIDeleteCodeScanResultDelete /code_scan_results/{id}delete code_scan_result
CodeScanResultsAPIGetCodeScanResultGet /code_scan_results/{id}show code_scan_result
CodeScanResultsAPIListCodeScanResultsForAppGet /apps/{app_id}/code_scan_resultslist code_scan_results
ConfigurationsAPICreateConfigurationForAppPost /apps/{app_id}/configurationscreate configuration
ConfigurationsAPICreateConfigurationForDatabasePost /databases/{database_id}/configurationscreate configuration
ConfigurationsAPIDeleteConfigurationDelete /configurations/{id}delete configuration
ConfigurationsAPIGetConfigurationGet /configurations/{id}show configuration
ConfigurationsAPIListConfigurationsForAppGet /apps/{app_id}/configurationslist configurations
ConfigurationsAPIListConfigurationsForDatabaseGet /databases/{database_id}/configurationslist configurations
ContainersAPIGetContainerGet /containers/{id}show container
ContainersAPIListContainersForReleaseGet /releases/{release_id}/containerslist containers
ContainersAPILogDrainsLogDrainIdContainersGetGet /log_drains/{log_drain_id}/containerslist containers
ContainersAPIMetricDrainsMetricDrainIdContainersGetGet /metric_drains/{metric_drain_id}/containerslist containers
DatabaseCredentialsAPIGetDatabaseCredentialGet /database_credentials/{id}show database_credential
DatabaseCredentialsAPIListDatabaseCredentialsForDatabaseGet /databases/{database_id}/database_credentialslist database_credentials
DatabasesAPICreateDatabasePost /accounts/{account_id}/databasescreate database
DatabasesAPIDeleteDatabaseDelete /databases/{id}delete database
DatabasesAPIGetDatabaseGet /databases/{id}show database
DatabasesAPIListDatabasesGet /databaseslist databases
DatabasesAPIListDatabasesForAccountGet /accounts/{account_id}/databaseslist databases
DatabasesAPIListReplicasForDatabaseGet /databases/{database_id}/dependentslist databases
DatabasesAPIPatchDatabasePatch /databases/{id}update database
DatabasesAPIUpdateDatabasePut /databases/{id}update database
DefaultAPIGetRootGet /show home
DeploymentsAPIGetDeploymentGet /deployments/{id}show deployment
DeploymentsAPIListDeploymentsGet /deploymentslist deployments
DeploymentsAPIListDeploymentsForAppGet /apps/{app_id}/deploymentslist deployments
DiskAttachmentsAPIGetDiskAttachmentGet /disk_attachments/{id}show disk attachment
DiskAttachmentsAPIListDiskAttachmentsForAccountGet /accounts/{account_id}/disk_attachmentslist disk attachments
DiskAttachmentsAPIListDiskAttachmentsForPersistentDiskGet /persistent_disks/{persistent_disk_id}/disk_attachmentslist disk attachments
DiskAttachmentsAPIListDiskAttachmentsForServiceGet /services/{service_id}/disk_attachmentslist disk attachments
DisksAPIGetDiskGet /disks/{id}show disk
DisksAPIListDisksForAccountGet /accounts/{account_id}/diskslist disks
EphemeralContainersAPIGetEphemeralContainerGet /ephemeral_containers/{id}show ephemeral_container
EphemeralContainersAPIListEphemeralContainersForEphemeralSessionGet /ephemeral_sessions/{ephemeral_session_id}/ephemeral_containerslist ephemeral_containers
EphemeralContainersAPIListEphemeralContainersForLogDrainGet /log_drains/{log_drain_id}/ephemeral_containerslist ephemeral_containers
EphemeralSessionsAPIGetEphemeralSessionGet /ephemeral_sessions/{id}show ephemeral_session
EphemeralSessionsAPIListEphemeralSessionsForAppGet /apps/{app_id}/ephemeral_sessionslist ephemeral_sessions
EphemeralSessionsAPIListEphemeralSessionsForOperationGet /operations/{operation_id}/ephemeral_sessionslist ephemeral_sessions
ImagesAPIGetDatabaseImageGet /database_images/{id}show database_image
ImagesAPIGetImageGet /images/{id}show image
ImagesAPIListDatabaseImagesGet /database_imageslist database_images
ImagesAPIListImagesForAppGet /apps/{app_id}/imageslist images
IntrusionDetectionReportsAPIGetIntrustionDetectionReportGet /intrusion_detection_reports/{id}show intrusion_detection_report
IntrusionDetectionReportsAPIGetIntrustionDetectionReportCsvDownloadGet /intrusion_detection_reports/{intrusion_report_id}/download_csvdownload_csv intrusion_detection_report
IntrusionDetectionReportsAPIGetIntrustionDetectionReportPdfDownloadGet /intrusion_detection_reports/{intrusion_report_id}/download_pdfdownload_pdf intrusion_detection_report
IntrusionDetectionReportsAPIListIntrustionDetectionReportsForStackGet /stacks/{stack_id}/intrusion_detection_reportslist intrusion_detection_reports
LogDrainsAPICreateLogDrainPost /accounts/{account_id}/log_drainscreate log_drain
LogDrainsAPIDeleteLogDrainDelete /log_drains/{id}delete log_drain
LogDrainsAPIGetLogDrainGet /log_drains/{id}show log_drain
LogDrainsAPIListLogDrainsForAccountGet /accounts/{account_id}/log_drainslist log_drains
LogDrainsAPIPatchLogDrainPatch /log_drains/{id}update log_drain
LogDrainsAPIUpdateLogDrainPut /log_drains/{id}update log_drain
MetricDrainsAPICreateMetricDrainPost /accounts/{account_id}/metric_drainscreate metric_drain
MetricDrainsAPIGetMetricDrainGet /metric_drains/{id}show metric_drain
MetricDrainsAPIListMetricDrainsForAccountGet /accounts/{account_id}/metric_drainslist metric_drains
OperationsAPICreateOperationForAppPost /apps/{app_id}/operationscreate operation
OperationsAPICreateOperationForBackupPost /backups/{backup_id}/operationscreate operation
OperationsAPICreateOperationForDatabasePost /databases/{database_id}/operationscreate operation
OperationsAPICreateOperationForDatabaseCredentialPost /database_credentials/{database_credential_id}/operationscreate operation
OperationsAPICreateOperationForDiskAttachmentPost /disk_attachments/{disk_attachment_id}/operationscreate operation
OperationsAPICreateOperationForEphemeralSessionPost /ephemeral_sessions/{ephemeral_session_id}/operationscreate operation
OperationsAPICreateOperationForImagePost /images/{image_id}/operationscreate operation
OperationsAPICreateOperationForLogDrainPost /log_drains/{log_drain_id}/operationscreate operation
OperationsAPICreateOperationForMetricDrainPost /metric_drains/{metric_drain_id}/operationscreate operation
OperationsAPICreateOperationForPersistentDiskPost /persistent_disks/{persistent_disk_id}/operationscreate operation
OperationsAPICreateOperationForServicePost /services/{service_id}/operationscreate operation
OperationsAPICreateOperationForVhostPost /vhosts/{vhost_id}/operationscreate operation
OperationsAPIGetOperationGet /operations/{id}show operation
OperationsAPIListOperationsForAccountGet /accounts/{account_id}/operationslist operations
OperationsAPIListOperationsForAppGet /apps/{app_id}/operationslist operations
OperationsAPIListOperationsForBackupGet /backups/{backup_id}/operationslist operations
OperationsAPIListOperationsForDatabaseGet /databases/{database_id}/operationslist operations
OperationsAPIListOperationsForDatabaseCredentialGet /database_credentials/{database_credential_id}/operationslist operations
OperationsAPIListOperationsForDiskAttachmentGet /disk_attachments/{disk_attachment_id}/operationslist operations
OperationsAPIListOperationsForEphemeralSessionGet /ephemeral_sessions/{ephemeral_session_id}/operationslist operations
OperationsAPIListOperationsForImageGet /images/{image_id}/operationslist operations
OperationsAPIListOperationsForLogDrainGet /log_drains/{log_drain_id}/operationslist operations
OperationsAPIListOperationsForMetricDrainGet /metric_drains/{metric_drain_id}/operationslist operations
OperationsAPIListOperationsForPersistentDiskGet /persistent_disks/{persistent_disk_id}/operationslist operations
OperationsAPIListOperationsForServiceGet /services/{service_id}/operationslist operations
OperationsAPIListOperationsForVhostGet /vhosts/{vhost_id}/operationslist operations
OperationsAPIPatchOperationPatch /operations/{id}update operation
OperationsAPIUpdateOperationPut /operations/{id}update operation
PermissionsAPICreatePermissionPost /accounts/{account_id}/permissionscreate permission
PermissionsAPIDeletePermissionDelete /permissions/{id}delete permission
PermissionsAPIGetPermissionGet /permissions/{id}show permission
PermissionsAPIListPermissionsGet /permissionslist permissions
PermissionsAPIListPermissionsForAccountGet /accounts/{account_id}/permissionslist permissions
PersistentDisksAPIGetPersistentDiskGet /persistent_disks/{id}show persistent disk
PersistentDisksAPIListPersistentDisksForAccountGet /accounts/{account_id}/persistent_diskslist persistent disks
PlansAPIGetPlanGet /plans/{id}show plan
PlansAPIListPlansGet /planslist plans
ReleasesAPIGetReleaseGet /releases/{id}show release
ReleasesAPIListReleasesForServiceGet /services/{service_id}/releaseslist releases
ServicesAPIGetServiceGet /services/{id}show service
ServicesAPIListServicesForAccountGet /accounts/{account_id}/serviceslist services
ServicesAPIListServicesForAppGet /apps/{app_id}/serviceslist services
SourcesAPIGetSourceGet /sources/{id}show source
SourcesAPIListAppsForSourceGet /sources/{source_id}/appslist apps
SourcesAPIListDeploymentsForSourceGet /sources/{source_id}/deploymentslist deployments
SourcesAPIListSourcesGet /sourceslist sources
SshPortalConnectionsAPICreateSshPortalConnectionPost /operations/{operation_id}/ssh_portal_connectionscreate ssh_portal_connection
SshPortalConnectionsAPIGetSshPortalConnectionGet /ssh_portal_connections/{id}show ssh_portal_connection
SshPortalConnectionsAPIListSshPortalConnectionsForOperationGet /operations/{operation_id}/ssh_portal_connectionslist ssh_portal_connections
StacksAPIGetStackGet /stacks/{id}show stack
StacksAPIListStacksGet /stackslist stacks
VhostsAPICreateVhostPost /services/{service_id}/vhostscreate vhost
VhostsAPIDeleteVhostDelete /vhosts/{id}delete vhost
VhostsAPIGetVhostGet /vhosts/{id}show vhost
VhostsAPIListVhostsForAccountGet /accounts/{account_id}/vhostslist vhosts
VhostsAPIListVhostsForAppGet /apps/{app_id}/vhostslist vhosts
VhostsAPIListVhostsForCertificateGet /certificates/{certificate_id}/vhostslist vhosts
VhostsAPIListVhostsForServiceGet /services/{service_id}/vhostslist vhosts
VhostsAPIPatchVhostPatch /vhosts/{id}update vhost
VhostsAPIUpdateVhostPut /vhosts/{id}update vhost
VpcPeersAPIGetVpcPeerGet /vpc_peers/{id}show vpc_peer
VpcPeersAPIListVpcPeersForStackGet /stacks/{stack_id}/vpc_peerslist vpc_peers
VpnTunnelsAPIGetVpnTunnelGet /vpn_tunnels/{id}show vpn_tunnel
VpnTunnelsAPIListVpnTunnelsForStackGet /stacks/{stack_id}/vpn_tunnelslist vpn_tunnels

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

token

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		aptibleapi.ContextAPIKeys,
		map[string]aptibleapi.APIKey{
			"Authorization": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author