Skip to content

cloudfoundry-community/capi-openapi-go-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for capiclient

API specification for managing environment variable groups in Cloud Controller.

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: v3
  • Package version: 1.0.0
  • Generator version: 7.9.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 capiclient "github.com/cloudfoundry-community/capi-openapi-go-client/capiclient"

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 capiclient.ContextServerIndex of type int.

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

Templated Server URL

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

ctx := context.WithValue(context.Background(), capiclient.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 capiclient.ContextOperationServerIndices and capiclient.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), capiclient.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), capiclient.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
AppUsageEventsAPI V3AppUsageEventsActionsDestructivelyPurgeAllAndReseedPost Post /v3/app_usage_events/actions/destructively_purge_all_and_reseed Purge and seed app usage events
AppUsageEventsAPI V3AppUsageEventsGet Get /v3/app_usage_events List app usage events
AppUsageEventsAPI V3AppUsageEventsGuidGet Get /v3/app_usage_events/{guid} Retrieve an app usage event
AuditEventsAPI V3AuditEventsGet Get /v3/audit_events List audit events
AuditEventsAPI V3AuditEventsGuidGet Get /v3/audit_events/{guid} Retrieve an audit event
DefaultAPI ApplyOrganizationQuotaToOrganizations Post /v3/organization_quotas/{quota_guid}/relationships/organizations Apply an organization quota to organizations
DefaultAPI AssignDefaultIsolationSegment Patch /v3/organizations/{guid}/relationships/default_isolation_segment Assign Default Isolation Segment
DefaultAPI CreateOrganization Post /v3/organizations Create an Organization
DefaultAPI CreateOrganizationQuota Post /v3/organization_quotas Create an organization quota
DefaultAPI DeleteOrganization Delete /v3/organizations/{guid} Delete an Organization
DefaultAPI DeleteOrganizationQuota Delete /v3/organization_quotas/{guid} Delete an organization quota
DefaultAPI GetDefaultDomain Get /v3/organizations/{guid}/domains/default Get Default Domain
DefaultAPI GetDefaultIsolationSegment Get /v3/organizations/{guid}/relationships/default_isolation_segment Get Default Isolation Segment
DefaultAPI GetOrganization Get /v3/organizations/{guid} Get an Organization
DefaultAPI GetOrganizationQuota Get /v3/organization_quotas/{guid} Get an organization quota
DefaultAPI GetUsageSummary Get /v3/organizations/{guid}/usage_summary Get Usage Summary
DefaultAPI ListOrganizationQuotas Get /v3/organization_quotas List organization quotas
DefaultAPI ListOrganizations Get /v3/organizations List Organizations
DefaultAPI ListUsersForOrganization Get /v3/organizations/{guid}/users List Users for an Organization
DefaultAPI RootGet Get / Global API Root
DefaultAPI UpdateOrganization Patch /v3/organizations/{guid} Update an Organization
DefaultAPI UpdateOrganizationQuota Patch /v3/organization_quotas/{guid} Update an organization quota
DefaultAPI V3AdminActionsClearBuildpackCachePost Post /v3/admin/actions/clear_buildpack_cache Clear buildpack cache
DefaultAPI V3AppsGet Get /v3/apps List apps
DefaultAPI V3AppsGuidActionsClearBuildpackCachePost Post /v3/apps/{guid}/actions/clear_buildpack_cache Clear buildpack cache for application
DefaultAPI V3AppsGuidActionsRestartPost Post /v3/apps/{guid}/actions/restart Restart an app
DefaultAPI V3AppsGuidActionsStartPost Post /v3/apps/{guid}/actions/start Start an app
DefaultAPI V3AppsGuidActionsStopPost Post /v3/apps/{guid}/actions/stop Stop an app
DefaultAPI V3AppsGuidBuildsGet Get /v3/apps/{guid}/builds List builds for an app
DefaultAPI V3AppsGuidDelete Delete /v3/apps/{guid} Delete an app
DefaultAPI V3AppsGuidDropletsCurrentGet Get /v3/apps/{guid}/droplets/current Get current droplet
DefaultAPI V3AppsGuidDropletsGet Get /v3/apps/{guid}/droplets List droplets for an app
DefaultAPI V3AppsGuidEnvGet Get /v3/apps/{guid}/env Get environment for an app
DefaultAPI V3AppsGuidEnvironmentVariablesGet Get /v3/apps/{guid}/environment_variables Get environment variables for an app
DefaultAPI V3AppsGuidEnvironmentVariablesPatch Patch /v3/apps/{guid}/environment_variables Update environment variables for an app
DefaultAPI V3AppsGuidFeaturesGet Get /v3/apps/{guid}/features List app features
DefaultAPI V3AppsGuidFeaturesNameGet Get /v3/apps/{guid}/features/{name} Get an app feature
DefaultAPI V3AppsGuidFeaturesNamePatch Patch /v3/apps/{guid}/features/{name} Update an app feature
DefaultAPI V3AppsGuidGet Get /v3/apps/{guid} Retrieve a specific app
DefaultAPI V3AppsGuidPatch Patch /v3/apps/{guid} Update an app
DefaultAPI V3AppsGuidPermissionsGet Get /v3/apps/{guid}/permissions Get permissions for an app
DefaultAPI V3AppsGuidProcessesGet Get /v3/apps/{guid}/processes List processes for app
DefaultAPI V3AppsGuidRelationshipsCurrentDropletGet Get /v3/apps/{guid}/relationships/current_droplet Get current droplet association for an app
DefaultAPI V3AppsGuidRevisionsDeployedGet Get /v3/apps/{guid}/revisions/deployed List deployed revisions for an app
DefaultAPI V3AppsGuidRevisionsGet Get /v3/apps/{guid}/revisions List revisions for an app
DefaultAPI V3AppsGuidRoutesGet Get /v3/apps/{guid}/routes Retrieve all routes for an app
DefaultAPI V3AppsGuidSidecarsGet Get /v3/apps/{guid}/sidecars List sidecars for an app
DefaultAPI V3AppsGuidSidecarsPost Post /v3/apps/{guid}/sidecars Create a sidecar associated with an app
DefaultAPI V3AppsGuidSshEnabledGet Get /v3/apps/{guid}/ssh_enabled Get SSH enabled for an app
DefaultAPI V3AppsGuidTasksPost Post /v3/apps/{guid}/tasks Create a task
DefaultAPI V3AppsPost Post /v3/apps Create an app
DefaultAPI V3BuildpacksGet Get /v3/buildpacks List buildpacks
DefaultAPI V3BuildpacksGuidPatch Patch /v3/buildpacks/{guid} Update a buildpack
DefaultAPI V3BuildpacksGuidUploadPost Post /v3/buildpacks/{guid}/upload Upload buildpack bits
DefaultAPI V3BuildpacksPost Post /v3/buildpacks Create a buildpack
DefaultAPI V3BuildsGet Get /v3/builds List builds
DefaultAPI V3BuildsGuidPatch Patch /v3/builds/{guid} Update a build
DefaultAPI V3BuildsPost Post /v3/builds Create a build
DefaultAPI V3DeploymentsGet Get /v3/deployments List deployments
DefaultAPI V3DeploymentsGuidActionsCancelPost Post /v3/deployments/{guid}/actions/cancel Cancel a deployment
DefaultAPI V3DeploymentsGuidActionsContinuePost Post /v3/deployments/{guid}/actions/continue Continue a deployment
DefaultAPI V3DeploymentsGuidGet Get /v3/deployments/{guid} Get a deployment
DefaultAPI V3DeploymentsPost Post /v3/deployments Create a deployment
DefaultAPI V3DropletsGet Get /v3/droplets List droplets
DefaultAPI V3DropletsGuidGet Get /v3/droplets/{guid} Get a droplet
DefaultAPI V3DropletsPost Post /v3/droplets Create a droplet
DefaultAPI V3EnvironmentVariableGroupsNameGet Get /v3/environment_variable_groups/{name} Get an environment variable group
DefaultAPI V3EnvironmentVariableGroupsNamePatch Patch /v3/environment_variable_groups/{name} Update environment variable group
DefaultAPI V3FeatureFlagsGet Get /v3/feature_flags List feature flags
DefaultAPI V3FeatureFlagsNameGet Get /v3/feature_flags/{name} Get a feature flag
DefaultAPI V3FeatureFlagsNamePatch Patch /v3/feature_flags/{name} Update a feature flag
DefaultAPI V3Get Get /v3 V3 API Root
DefaultAPI V3InfoGet Get /v3/info Get platform info
DefaultAPI V3InfoUsageSummaryGet Get /v3/info/usage_summary Get platform usage summary
DefaultAPI V3IsolationSegmentsGet Get /v3/isolation_segments List isolation segments
DefaultAPI V3IsolationSegmentsGuidDelete Delete /v3/isolation_segments/{guid} Delete an isolation segment
DefaultAPI V3IsolationSegmentsGuidGet Get /v3/isolation_segments/{guid} Get an isolation segment
DefaultAPI V3IsolationSegmentsGuidPatch Patch /v3/isolation_segments/{guid} Update an isolation segment
DefaultAPI V3IsolationSegmentsGuidRelationshipsOrganizationsGet Get /v3/isolation_segments/{guid}/relationships/organizations List organizations relationship
DefaultAPI V3IsolationSegmentsGuidRelationshipsOrganizationsOrgGuidDelete Delete /v3/isolation_segments/{guid}/relationships/organizations/{org_guid} Revoke entitlement to isolation segment for an organization
DefaultAPI V3IsolationSegmentsGuidRelationshipsOrganizationsPost Post /v3/isolation_segments/{guid}/relationships/organizations Entitle organizations for an isolation segment
DefaultAPI V3IsolationSegmentsGuidRelationshipsSpacesGet Get /v3/isolation_segments/{guid}/relationships/spaces List spaces relationship
DefaultAPI V3IsolationSegmentsPost Post /v3/isolation_segments Create an isolation segment
DefaultAPI V3PackagesGet Get /v3/packages List packages
DefaultAPI V3PackagesGuidDelete Delete /v3/packages/{guid} Delete a package
DefaultAPI V3PackagesGuidDropletsGet Get /v3/packages/{guid}/droplets List droplets for a package
DefaultAPI V3PackagesGuidGet Get /v3/packages/{guid} Get a package
DefaultAPI V3PackagesGuidPatch Patch /v3/packages/{guid} Update a package
DefaultAPI V3PackagesGuidUploadPost Post /v3/packages/{guid}/upload Upload package bits
DefaultAPI V3PackagesPost Post /v3/packages Create a package
DefaultAPI V3ProcessesGet Get /v3/processes List processes
DefaultAPI V3ProcessesGuidActionsScalePost Post /v3/processes/{guid}/actions/scale Scale a process
DefaultAPI V3ProcessesGuidInstancesIndexDelete Delete /v3/processes/{guid}/instances/{index} Terminate a process instance
DefaultAPI V3ProcessesGuidPatch Patch /v3/processes/{guid} Update a process
DefaultAPI V3ProcessesGuidSidecarsGet Get /v3/processes/{guid}/sidecars List sidecars for a process
DefaultAPI V3ProcessesGuidStatsGet Get /v3/processes/{guid}/stats Get stats for a process
DefaultAPI V3ResourceMatchesPost Post /v3/resource_matches Create a resource match
DefaultAPI V3RevisionsGuidEnvironmentVariablesGet Get /v3/revisions/{guid}/environment_variables Get environment variables for a revision
DefaultAPI V3RevisionsGuidPatch Patch /v3/revisions/{guid} Update a revision
DefaultAPI V3RolesGet Get /v3/roles List roles
DefaultAPI V3RolesGuidDelete Delete /v3/roles/{guid} Delete a role
DefaultAPI V3RolesGuidGet Get /v3/roles/{guid} Get a role
DefaultAPI V3RolesPost Post /v3/roles Create a role
DefaultAPI V3RoutesGet Get /v3/routes List routes
DefaultAPI V3RoutesGuidGet Get /v3/routes/{guid} Get a route
DefaultAPI V3RoutesPost Post /v3/routes Create a route
DefaultAPI V3SecurityGroupsGet Get /v3/security_groups List security groups
DefaultAPI V3SecurityGroupsGuidDelete Delete /v3/security_groups/{guid} Delete a security group
DefaultAPI V3SecurityGroupsGuidGet Get /v3/security_groups/{guid} Get a security group
DefaultAPI V3SecurityGroupsGuidPatch Patch /v3/security_groups/{guid} Update a security group
DefaultAPI V3SecurityGroupsPost Post /v3/security_groups Create a security group
DefaultAPI V3ServiceBrokersGet Get /v3/service_brokers List service brokers
DefaultAPI V3ServiceBrokersGuidDelete Delete /v3/service_brokers/{guid} Delete a service broker
DefaultAPI V3ServiceBrokersGuidGet Get /v3/service_brokers/{guid} Get a service broker
DefaultAPI V3ServiceBrokersGuidPatch Patch /v3/service_brokers/{guid} Update a service broker
DefaultAPI V3ServiceBrokersPost Post /v3/service_brokers Create a service broker
DefaultAPI V3ServiceCredentialBindingsGuidDelete Delete /v3/service_credential_bindings/{guid} Delete a service credential binding
DefaultAPI V3ServiceCredentialBindingsGuidDetailsGet Get /v3/service_credential_bindings/{guid}/details Get a service credential binding details
DefaultAPI V3ServiceCredentialBindingsGuidGet Get /v3/service_credential_bindings/{guid} Get a service credential binding
DefaultAPI V3ServiceCredentialBindingsGuidParametersGet Get /v3/service_credential_bindings/{guid}/parameters Get parameters for a service credential binding
DefaultAPI V3ServiceCredentialBindingsGuidPatch Patch /v3/service_credential_bindings/{guid} Update a service credential binding
DefaultAPI V3ServiceCredentialBindingsPost Post /v3/service_credential_bindings Create a service credential binding
DefaultAPI V3ServiceInstancesGet Get /v3/service_instances Retrieve service instances
DefaultAPI V3ServiceInstancesGuidCredentialsGet Get /v3/service_instances/{guid}/credentials Get credentials for a user-provided service instance
DefaultAPI V3ServiceInstancesGuidPatch Patch /v3/service_instances/{guid} Update a service instance
DefaultAPI V3ServiceInstancesGuidRelationshipsSharedSpacesPost Post /v3/service_instances/{guid}/relationships/shared_spaces Share a service instance to other spaces
DefaultAPI V3ServiceInstancesGuidRelationshipsSharedSpacesSpaceGuidDelete Delete /v3/service_instances/{guid}/relationships/shared_spaces/{space_guid} Unshare a service instance from another space
DefaultAPI V3ServiceInstancesGuidRelationshipsSharedSpacesUsageSummaryGet Get /v3/service_instances/{guid}/relationships/shared_spaces/usage_summary Get usage summary in shared spaces
DefaultAPI V3ServiceOfferingsGet Get /v3/service_offerings List service offerings
DefaultAPI V3ServiceOfferingsGuidDelete Delete /v3/service_offerings/{guid} Delete a service offering
DefaultAPI V3ServiceOfferingsGuidGet Get /v3/service_offerings/{guid} Get a service offering
DefaultAPI V3ServiceOfferingsGuidPatch Patch /v3/service_offerings/{guid} Update a service offering
DefaultAPI V3ServiceOfferingsPost Post /v3/service_offerings Create a service offering
DefaultAPI V3ServicePlansGet Get /v3/service_plans List service plans
DefaultAPI V3ServicePlansGuidDelete Delete /v3/service_plans/{guid} Delete a service plan
DefaultAPI V3ServicePlansGuidGet Get /v3/service_plans/{guid} Get a service plan
DefaultAPI V3ServicePlansGuidPatch Patch /v3/service_plans/{guid} Update a service plan
DefaultAPI V3ServicePlansGuidVisibilityGet Get /v3/service_plans/{guid}/visibility Get a service plan visibility
DefaultAPI V3ServicePlansGuidVisibilityOrganizationGuidDelete Delete /v3/service_plans/{guid}/visibility/{organization_guid} Remove organization from a service plan visibility
DefaultAPI V3ServicePlansGuidVisibilityPatch Patch /v3/service_plans/{guid}/visibility Update a service plan visibility
DefaultAPI V3ServicePlansGuidVisibilityPost Post /v3/service_plans/{guid}/visibility Apply a service plan visibility
DefaultAPI V3ServicePlansPost Post /v3/service_plans Create a service plan
DefaultAPI V3ServiceRouteBindingsGet Get /v3/service_route_bindings List service route bindings
DefaultAPI V3ServiceRouteBindingsGuidDelete Delete /v3/service_route_bindings/{guid} Delete a service route binding
DefaultAPI V3ServiceRouteBindingsGuidGet Get /v3/service_route_bindings/{guid} Get a service route binding
DefaultAPI V3ServiceRouteBindingsGuidParametersGet Get /v3/service_route_bindings/{guid}/parameters Get parameters for a route binding
DefaultAPI V3ServiceRouteBindingsGuidPatch Patch /v3/service_route_bindings/{guid} Update a service route binding
DefaultAPI V3ServiceRouteBindingsPost Post /v3/service_route_bindings Create a service route binding
DefaultAPI V3ServiceUsageEventsGet Get /v3/service_usage_events List service usage events
DefaultAPI V3ServiceUsageEventsGuidGet Get /v3/service_usage_events/{guid} Get a service usage event
DefaultAPI V3ServiceUsageEventsPost Post /v3/service_usage_events Purge and seed service usage events
DefaultAPI V3SidecarsGuidDelete Delete /v3/sidecars/{guid} Delete a sidecar
DefaultAPI V3SidecarsGuidGet Get /v3/sidecars/{guid} Get a sidecar
DefaultAPI V3SidecarsGuidPatch Patch /v3/sidecars/{guid} Update a sidecar
DefaultAPI V3SpaceQuotasGet Get /v3/space_quotas List space quotas
DefaultAPI V3SpaceQuotasGuidDelete Delete /v3/space_quotas/{guid} Delete a space quota
DefaultAPI V3SpaceQuotasGuidGet Get /v3/space_quotas/{guid} Get a space quota
DefaultAPI V3SpaceQuotasGuidPatch Patch /v3/space_quotas/{guid} Update a space quota
DefaultAPI V3SpaceQuotasPost Post /v3/space_quotas Create a space quota
DefaultAPI V3SpaceQuotasQuotaGuidRelationshipsSpacesPost Post /v3/space_quotas/{quota_guid}/relationships/spaces Apply a space quota to spaces
DefaultAPI V3SpaceQuotasQuotaGuidRelationshipsSpacesSpaceGuidDelete Delete /v3/space_quotas/{quota_guid}/relationships/spaces/{space_guid} Remove a space quota from a space
DefaultAPI V3SpacesGet Get /v3/spaces List spaces
DefaultAPI V3SpacesGuidDelete Delete /v3/spaces/{guid} Delete a space
DefaultAPI V3SpacesGuidFeaturesGet Get /v3/spaces/{guid}/features List space features
DefaultAPI V3SpacesGuidFeaturesNameGet Get /v3/spaces/{guid}/features/{name} Get a space feature
DefaultAPI V3SpacesGuidFeaturesPatch Patch /v3/spaces/{guid}/features Update space features
DefaultAPI V3SpacesGuidGet Get /v3/spaces/{guid} Get a space
DefaultAPI V3SpacesGuidPatch Patch /v3/spaces/{guid} Update a space
DefaultAPI V3SpacesGuidRelationshipsIsolationSegmentGet Get /v3/spaces/{guid}/relationships/isolation_segment Get assigned isolation segment
DefaultAPI V3SpacesGuidRelationshipsIsolationSegmentPatch Patch /v3/spaces/{guid}/relationships/isolation_segment Manage isolation segment
DefaultAPI V3SpacesGuidUsersGet Get /v3/spaces/{guid}/users List users for a space
DefaultAPI V3SpacesPost Post /v3/spaces Create a space
DefaultAPI V3StacksGet Get /v3/stacks List all stacks
DefaultAPI V3StacksGuidAppsGet Get /v3/stacks/{guid}/apps List apps on a stack
DefaultAPI V3StacksGuidDelete Delete /v3/stacks/{guid} Delete a stack
DefaultAPI V3StacksGuidGet Get /v3/stacks/{guid} Get a stack by GUID
DefaultAPI V3StacksGuidPatch Patch /v3/stacks/{guid} Update a stack
DefaultAPI V3StacksPost Post /v3/stacks Create a stack
DefaultAPI V3TasksGet Get /v3/tasks List all tasks
DefaultAPI V3TasksGuidGet Get /v3/tasks/{guid} Get a task
DefaultAPI V3TasksGuidPatch Patch /v3/tasks/{guid} Update a task
DefaultAPI V3TasksGuidPost Post /v3/tasks/{guid} Cancel a task
DefaultAPI V3UsersGet Get /v3/users List users
DefaultAPI V3UsersGuidDelete Delete /v3/users/{guid} Delete a user
DefaultAPI V3UsersGuidGet Get /v3/users/{guid} Get a user
DefaultAPI V3UsersGuidPatch Patch /v3/users/{guid} Update a user
DefaultAPI V3UsersPost Post /v3/users Create a user
DomainsAPI V3DomainsGet Get /v3/domains List domains
DomainsAPI V3DomainsGuidDelete Delete /v3/domains/{guid} Delete a domain
DomainsAPI V3DomainsGuidGet Get /v3/domains/{guid} Get a domain
DomainsAPI V3DomainsGuidPatch Patch /v3/domains/{guid} Update a domain
DomainsAPI V3DomainsGuidRelationshipsSharedOrganizationsOrgGuidDelete Delete /v3/domains/{guid}/relationships/shared_organizations/{org_guid} Unshare a domain
DomainsAPI V3DomainsGuidRelationshipsSharedOrganizationsPost Post /v3/domains/{guid}/relationships/shared_organizations Share a domain
DomainsAPI V3DomainsPost Post /v3/domains Create a domain

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), capiclient.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:

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

Author

About

CAPI OpenAPI Generated Go Client

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages