| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .github/workflows | ||
| .openapi-generator | ||
| api | ||
| docs | ||
| test | ||
| .gitignore | ||
| .openapi-generator-ignore | ||
| api_adoption_approval.go | ||
| api_application.go | ||
| api_credit_transaction.go | ||
| api_deployment.go | ||
| api_managed_service.go | ||
| api_organization.go | ||
| api_service_binding.go | ||
| api_swarm.go | ||
| client.go | ||
| configuration.go | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| model_adoption_approval.go | ||
| model_adoption_approval_adoption_approval_input.go | ||
| model_application.go | ||
| model_application_json_merge_patch.go | ||
| model_bundle_additional_context_input.go | ||
| model_bundle_context_input.go | ||
| model_bundle_forwarded_image_input.go | ||
| model_bundle_upload_target.go | ||
| model_constraint_violation.go | ||
| model_constraint_violation_violations_inner.go | ||
| model_credit_transaction.go | ||
| model_credit_transaction_engine_millis.go | ||
| model_credit_transaction_usage_bytes.go | ||
| model_deployment.go | ||
| model_deployment_bundle_upload_confirm_input.go | ||
| model_deployment_bundle_upload_confirm_output.go | ||
| model_deployment_bundle_upload_declare_input.go | ||
| model_deployment_bundle_upload_declare_output.go | ||
| model_deployment_deployment_endpoint.go | ||
| model_deployment_json_merge_patch.go | ||
| model_deployment_json_merge_patch_build_contexts_value_value.go | ||
| model_deployment_json_merge_patch_canonical_spec_value.go | ||
| model_deployment_variable.go | ||
| model_error.go | ||
| model_failure.go | ||
| model_machine.go | ||
| model_managed_service.go | ||
| model_managed_service_last_load_millis.go | ||
| model_managed_service_managed_service_input.go | ||
| model_managed_service_pending_load_millis.go | ||
| model_managed_service_quota_bytes.go | ||
| model_managed_service_usage_bytes.go | ||
| model_membership.go | ||
| model_o_auth_identity.go | ||
| model_organization.go | ||
| model_organization_json_merge_patch.go | ||
| model_organization_signal.go | ||
| model_port_allocation.go | ||
| model_proxmox_instance.go | ||
| model_recovery_code.go | ||
| model_sealed_secret.go | ||
| model_service.go | ||
| model_service_binding.go | ||
| model_service_binding_service_binding_input.go | ||
| model_service_cpu_limit.go | ||
| model_service_cpu_reservation.go | ||
| model_service_healthcheck_value.go | ||
| model_service_instance.go | ||
| model_service_instance_capacity_bytes.go | ||
| model_service_instance_observed_usage_bytes.go | ||
| model_service_mem_limit.go | ||
| model_service_mem_reservation.go | ||
| model_service_ports_inner_value.go | ||
| model_swarm.go | ||
| model_swarm_json_merge_patch.go | ||
| model_swarm_node.go | ||
| model_user.go | ||
| model_user_avatar_photo.go | ||
| model_variable.go | ||
| model_variable_version.go | ||
| README.md | ||
| response.go | ||
| utils.go | ||
Go API client for someonescomputer
JSON-LD resources backing the control panel. Bearer-token reachable since #1418 — see docs/sdk-generation.md.
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: 1.0.0
- Package version: 1.0.0
- Generator version: 7.11.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 someonescomputer "github.com/someones-computer/sdk-go"
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 someonescomputer.ContextServerIndex of type int.
ctx := context.WithValue(context.Background(), someonescomputer.ContextServerIndex, 1)
Templated Server URL
Templated server URL is formatted using default variables from configuration or from context value someonescomputer.ContextServerVariables of type map[string]string.
ctx := context.WithValue(context.Background(), someonescomputer.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 someonescomputer.ContextOperationServerIndices and someonescomputer.ContextOperationServerVariables context maps.
ctx := context.WithValue(context.Background(), someonescomputer.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), someonescomputer.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
Documentation for API Endpoints
All URIs are relative to http://localhost
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AdoptionApprovalAPI | ApiAdoptionApprovalsGetCollection | Get /api/adoption_approvals | Retrieves the collection of AdoptionApproval resources. |
| AdoptionApprovalAPI | ApiAdoptionApprovalsIdDelete | Delete /api/adoption_approvals/{id} | Removes the AdoptionApproval resource. |
| AdoptionApprovalAPI | ApiAdoptionApprovalsIdGet | Get /api/adoption_approvals/{id} | Retrieves a AdoptionApproval resource. |
| AdoptionApprovalAPI | ApiAdoptionApprovalsPost | Post /api/adoption_approvals | Creates a AdoptionApproval resource. |
| ApplicationAPI | ApiApplicationsGetCollection | Get /api/applications | Retrieves the collection of Application resources. |
| ApplicationAPI | ApiApplicationsIdDelete | Delete /api/applications/{id} | Removes the Application resource. |
| ApplicationAPI | ApiApplicationsIdGet | Get /api/applications/{id} | Retrieves a Application resource. |
| ApplicationAPI | ApiApplicationsIdPatch | Patch /api/applications/{id} | Updates the Application resource. |
| ApplicationAPI | ApiApplicationsPost | Post /api/applications | Creates a Application resource. |
| CreditTransactionAPI | ApiCreditTransactionsGetCollection | Get /api/credit_transactions | Retrieves the collection of CreditTransaction resources. |
| CreditTransactionAPI | ApiCreditTransactionsIdGet | Get /api/credit_transactions/{id} | Retrieves a CreditTransaction resource. |
| DeploymentAPI | ApiDeploymentsGetCollection | Get /api/deployments | Retrieves the collection of Deployment resources. |
| DeploymentAPI | ApiDeploymentsIdDelete | Delete /api/deployments/{id} | Removes the Deployment resource. |
| DeploymentAPI | ApiDeploymentsIdGet | Get /api/deployments/{id} | Retrieves a Deployment resource. |
| DeploymentAPI | ApiDeploymentsIdPatch | Patch /api/deployments/{id} | Updates the Deployment resource. |
| DeploymentAPI | ApiDeploymentsIdendpointsGetCollection | Get /api/deployments/{id}/endpoints | Retrieves the collection of Deployment resources. |
| DeploymentAPI | ApiDeploymentsPost | Post /api/deployments | Creates a Deployment resource. |
| DeploymentAPI | BundleUploadConfirm | Post /api/deployments/bundle_uploads/confirm | Creates a Deployment resource. |
| DeploymentAPI | BundleUploadDeclare | Post /api/deployments/bundle_uploads | Creates a Deployment resource. |
| ManagedServiceAPI | ApiManagedServicesGetCollection | Get /api/managed_services | Retrieves the collection of ManagedService resources. |
| ManagedServiceAPI | ApiManagedServicesIdDelete | Delete /api/managed_services/{id} | Removes the ManagedService resource. |
| ManagedServiceAPI | ApiManagedServicesIdGet | Get /api/managed_services/{id} | Retrieves a ManagedService resource. |
| ManagedServiceAPI | ApiManagedServicesPost | Post /api/managed_services | Creates a ManagedService resource. |
| ManagedServiceAPI | Resume | Post /api/managed_services/{id}/resume | Creates a ManagedService resource. |
| ManagedServiceAPI | Suspend | Post /api/managed_services/{id}/suspend | Creates a ManagedService resource. |
| OrganizationAPI | ApiOrganizationsGetCollection | Get /api/organizations | Retrieves the collection of Organization resources. |
| OrganizationAPI | ApiOrganizationsIdDelete | Delete /api/organizations/{id} | Removes the Organization resource. |
| OrganizationAPI | ApiOrganizationsIdGet | Get /api/organizations/{id} | Retrieves a Organization resource. |
| OrganizationAPI | ApiOrganizationsIdPatch | Patch /api/organizations/{id} | Updates the Organization resource. |
| OrganizationAPI | ApiOrganizationsPost | Post /api/organizations | Creates a Organization resource. |
| ServiceBindingAPI | ApiServiceBindingsGetCollection | Get /api/service_bindings | Retrieves the collection of ServiceBinding resources. |
| ServiceBindingAPI | ApiServiceBindingsIdDelete | Delete /api/service_bindings/{id} | Removes the ServiceBinding resource. |
| ServiceBindingAPI | ApiServiceBindingsIdGet | Get /api/service_bindings/{id} | Retrieves a ServiceBinding resource. |
| ServiceBindingAPI | ApiServiceBindingsPost | Post /api/service_bindings | Creates a ServiceBinding resource. |
| SwarmAPI | ApiSwarmsGetCollection | Get /api/swarms | Retrieves the collection of Swarm resources. |
| SwarmAPI | ApiSwarmsIdDelete | Delete /api/swarms/{id} | Removes the Swarm resource. |
| SwarmAPI | ApiSwarmsIdGet | Get /api/swarms/{id} | Retrieves a Swarm resource. |
| SwarmAPI | ApiSwarmsIdPatch | Patch /api/swarms/{id} | Updates the Swarm resource. |
| SwarmAPI | ApiSwarmsPost | Post /api/swarms | Creates a Swarm resource. |
Documentation For Models
- AdoptionApproval
- AdoptionApprovalAdoptionApprovalInput
- Application
- ApplicationJsonMergePatch
- BundleAdditionalContextInput
- BundleContextInput
- BundleForwardedImageInput
- BundleUploadTarget
- ConstraintViolation
- ConstraintViolationViolationsInner
- CreditTransaction
- CreditTransactionEngineMillis
- CreditTransactionUsageBytes
- Deployment
- DeploymentBundleUploadConfirmInput
- DeploymentBundleUploadConfirmOutput
- DeploymentBundleUploadDeclareInput
- DeploymentBundleUploadDeclareOutput
- DeploymentDeploymentEndpoint
- DeploymentJsonMergePatch
- DeploymentJsonMergePatchBuildContextsValueValue
- DeploymentJsonMergePatchCanonicalSpecValue
- DeploymentVariable
- Error
- Failure
- Machine
- ManagedService
- ManagedServiceLastLoadMillis
- ManagedServiceManagedServiceInput
- ManagedServicePendingLoadMillis
- ManagedServiceQuotaBytes
- ManagedServiceUsageBytes
- Membership
- OAuthIdentity
- Organization
- OrganizationJsonMergePatch
- OrganizationSignal
- PortAllocation
- ProxmoxInstance
- RecoveryCode
- SealedSecret
- Service
- ServiceBinding
- ServiceBindingServiceBindingInput
- ServiceCpuLimit
- ServiceCpuReservation
- ServiceHealthcheckValue
- ServiceInstance
- ServiceInstanceCapacityBytes
- ServiceInstanceObservedUsageBytes
- ServiceMemLimit
- ServiceMemReservation
- ServicePortsInnerValue
- Swarm
- SwarmJsonMergePatch
- SwarmNode
- User
- UserAvatarPhoto
- Variable
- VariableVersion
Documentation For Authorization
Authentication schemes defined for the API:
bearerAuth
- Type: HTTP Bearer token authentication
Example
auth := context.WithValue(context.Background(), someonescomputer.ContextAccessToken, "BEARER_TOKEN_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:
PtrBoolPtrIntPtrInt32PtrInt64PtrFloatPtrFloat32PtrFloat64PtrStringPtrTime