Skip to content

Files

Latest commit

a428637 · Nov 22, 2024

History

History

release

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Nov 22, 2024
Nov 22, 2024
Sep 4, 2024
Jun 17, 2024
Feb 5, 2024
Feb 5, 2024
Feb 5, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Feb 5, 2024
Apr 22, 2024
Apr 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024
Nov 22, 2024

Go API client for caliri

Candlepin is a subscription management server written in Java. It helps with management of software subscriptions.

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: 4.5.0
  • Package version: 4.5.0
  • Generator version: 7.10.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 caliri "github.com/content-services/caliri/release/v4"

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

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

Templated Server URL

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

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

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

Documentation for API Endpoints

All URIs are relative to /candlepin

Class Method HTTP request Description
ActivationKeyAPI AddActivationKeyContentOverrides Put /activation_keys/{activation_key_id}/content_overrides
ActivationKeyAPI AddPoolToKey Post /activation_keys/{activation_key_id}/pools/{pool_id}
ActivationKeyAPI AddProductIdToKey Post /activation_keys/{activation_key_id}/product/{product_id}
ActivationKeyAPI DeleteActivationKey Delete /activation_keys/{activation_key_id}
ActivationKeyAPI DeleteActivationKeyContentOverrides Delete /activation_keys/{activation_key_id}/content_overrides
ActivationKeyAPI FindActivationKey Get /activation_keys
ActivationKeyAPI GetActivationKey Get /activation_keys/{activation_key_id}
ActivationKeyAPI GetActivationKeyPools Get /activation_keys/{activation_key_id}/pools
ActivationKeyAPI ListActivationKeyContentOverrides Get /activation_keys/{activation_key_id}/content_overrides
ActivationKeyAPI RemovePoolFromKey Delete /activation_keys/{activation_key_id}/pools/{pool_id}
ActivationKeyAPI RemoveProductIdFromKey Delete /activation_keys/{activation_key_id}/product/{product_id}
ActivationKeyAPI UpdateActivationKey Put /activation_keys/{activation_key_id}
AdminAPI GetQueueStats Get /admin/queues
AdminAPI Initialize Get /admin/init
CdnAPI CreateCdn Post /cdn
CdnAPI DeleteCdn Delete /cdn/{label}
CdnAPI GetContentDeliveryNetworks Get /cdn
CdnAPI UpdateCdn Put /cdn/{label}
CertificateRevocationListAPI GetCurrentCrl Get /crl
CertificateSerialAPI GetCertificateSerial Get /serials/{id}
CloudRegistrationAPI CancelCloudAccountJobs Delete /cloud/jobs/orgsetup/{cloud_account_id}
CloudRegistrationAPI CloudAuthorize Post /cloud/authorize
CloudRegistrationAPI DeleteAnonymousConsumersByAccountId Delete /cloud/consumers/anonymous
ConsumerAPI AddConsumerContentOverrides Put /consumers/{consumer_uuid}/content_overrides
ConsumerAPI Bind Post /consumers/{consumer_uuid}/entitlements
ConsumerAPI ConsumerExists Head /consumers/{consumer_uuid}/exists
ConsumerAPI ConsumerExistsBulk Post /consumers/exists
ConsumerAPI CreateConsumer Post /consumers
ConsumerAPI DeleteConsumer Delete /consumers/{consumer_uuid}
ConsumerAPI DeleteConsumerContentOverrides Delete /consumers/{consumer_uuid}/content_overrides
ConsumerAPI DownloadExistingExport Get /consumers/{consumer_uuid}/export/{export_id}
ConsumerAPI DryBind Get /consumers/{consumer_uuid}/entitlements/dry-run
ConsumerAPI ExportCertificates Get /consumers/{consumer_uuid}/certificates
ConsumerAPI ExportData Get /consumers/{consumer_uuid}/export
ConsumerAPI ExportDataAsync Get /consumers/{consumer_uuid}/export/async
ConsumerAPI GetComplianceStatus Get /consumers/{consumer_uuid}/compliance
ConsumerAPI GetComplianceStatusList Get /consumers/compliance
ConsumerAPI GetConsumer Get /consumers/{consumer_uuid}
ConsumerAPI GetContentAccessBody Get /consumers/{consumer_uuid}/accessible_content
ConsumerAPI GetContentAccessForConsumer Get /consumers/{consumer_uuid}/content_access
ConsumerAPI GetEntitlementCertificateSerials Get /consumers/{consumer_uuid}/certificates/serials
ConsumerAPI GetGuests Get /consumers/{consumer_uuid}/guests
ConsumerAPI GetHost Get /consumers/{consumer_uuid}/host
ConsumerAPI GetOwnerByConsumerUuid Get /consumers/{consumer_uuid}/owner
ConsumerAPI GetRelease Get /consumers/{consumer_uuid}/release
ConsumerAPI GetSystemPurposeComplianceStatus Get /consumers/{consumer_uuid}/purpose_compliance
ConsumerAPI ListConsumerContentOverrides Get /consumers/{consumer_uuid}/content_overrides
ConsumerAPI ListEntitlements Get /consumers/{consumer_uuid}/entitlements
ConsumerAPI RegenerateEntitlementCertificates Put /consumers/{consumer_uuid}/certificates
ConsumerAPI RegenerateIdentityCertificates Post /consumers/{consumer_uuid}
ConsumerAPI RemoveDeletionRecord Delete /consumers/{consumer_uuid}/deletionrecord
ConsumerAPI SearchConsumers Get /consumers
ConsumerAPI UnbindAll Delete /consumers/{consumer_uuid}/entitlements
ConsumerAPI UnbindByEntitlementId Delete /consumers/{consumer_uuid}/entitlements/{dbid}
ConsumerAPI UnbindByPool Delete /consumers/{consumer_uuid}/entitlements/pool/{pool_id}
ConsumerAPI UnbindBySerial Delete /consumers/{consumer_uuid}/certificates/{serial}
ConsumerAPI UpdateConsumer Put /consumers/{consumer_uuid}
ConsumerTypeAPI CreateConsumerType Post /consumertypes
ConsumerTypeAPI DeleteConsumerType Delete /consumertypes/{id}
ConsumerTypeAPI GetConsumerType Get /consumertypes/{id}
ConsumerTypeAPI GetConsumerTypes Get /consumertypes
ConsumerTypeAPI UpdateConsumerType Put /consumertypes/{id}
ContentAPI GetContentByUuid Get /content/{content_uuid}
ContentAPI GetContents Get /content
DeletedConsumerAPI ListByDate Get /deleted_consumers
DistributorVersionsAPI Create Post /distributor_versions
DistributorVersionsAPI Delete Delete /distributor_versions/{id}
DistributorVersionsAPI GetVersions Get /distributor_versions
DistributorVersionsAPI Update Put /distributor_versions/{id}
EntitlementsAPI GetEntitlement Get /entitlements/{entitlement_id}
EntitlementsAPI GetUpstreamCert Get /entitlements/{dbid}/upstream_cert
EntitlementsAPI HasEntitlement Get /entitlements/consumer/{consumer_uuid}/product/{product_id}
EntitlementsAPI ListAllForConsumer Get /entitlements
EntitlementsAPI MigrateEntitlement Put /entitlements/{entitlement_id}/migrate
EntitlementsAPI RegenerateEntitlementCertificatesForProduct Put /entitlements/product/{product_id}
EntitlementsAPI Unbind Delete /entitlements/{dbid}
EntitlementsAPI UpdateEntitlement Put /entitlements/{entitlement_id}
EnvironmentAPI CreateConsumerInEnvironment Post /environments/{env_id}/consumers
EnvironmentAPI DeleteEnvironment Delete /environments/{env_id}
EnvironmentAPI DeleteEnvironmentContentOverrides Delete /environments/{environment_id}/content_overrides
EnvironmentAPI DemoteContent Delete /environments/{env_id}/content
EnvironmentAPI GetEnvironment Get /environments/{env_id}
EnvironmentAPI GetEnvironmentContentOverrides Get /environments/{environment_id}/content_overrides
EnvironmentAPI PromoteContent Post /environments/{env_id}/content
EnvironmentAPI PutEnvironmentContentOverrides Put /environments/{environment_id}/content_overrides
EnvironmentAPI UpdateEnvironment Put /environments/{env_id}
GuestIdsAPI DeleteGuest Delete /consumers/{consumer_uuid}/guestids/{guest_id}
GuestIdsAPI GetGuestId Get /consumers/{consumer_uuid}/guestids/{guest_id}
GuestIdsAPI GetGuestIds Get /consumers/{consumer_uuid}/guestids
GuestIdsAPI UpdateGuest Put /consumers/{consumer_uuid}/guestids/{guest_id}
GuestIdsAPI UpdateGuests Put /consumers/{consumer_uuid}/guestids
HypervisorsAPI HypervisorHeartbeatUpdate Put /hypervisors/{owner}/heartbeat
HypervisorsAPI HypervisorUpdateAsync Post /hypervisors/{owner}
JobsAPI CancelJob Delete /jobs/{id}
JobsAPI CleanupTerminalJobs Delete /jobs
JobsAPI GetJobStatus Get /jobs/{id}
JobsAPI GetSchedulerStatus Get /jobs/scheduler
JobsAPI ListJobStatuses Get /jobs
JobsAPI ScheduleJob Post /jobs/schedule/{jobKey}
JobsAPI SetSchedulerStatus Post /jobs/scheduler
OwnerAPI Claim Put /owners/{anonymous_owner_key}/claim
OwnerAPI CountConsumers Get /owners/{owner_key}/consumers/count
OwnerAPI CreateActivationKey Post /owners/{owner_key}/activation_keys
OwnerAPI CreateEnvironment Post /owners/{owner_key}/environments
OwnerAPI CreateOwner Post /owners
OwnerAPI CreatePool Post /owners/{owner_key}/pools
OwnerAPI CreateUeberCertificate Post /owners/{owner_key}/uebercert
OwnerAPI DeleteLogLevel Delete /owners/{owner_key}/log
OwnerAPI DeleteOwner Delete /owners/{owner_key}
OwnerAPI GetConsumersSyspurpose Get /owners/{owner_key}/consumers_system_purpose
OwnerAPI GetHypervisors Get /owners/{owner_key}/hypervisors
OwnerAPI GetImports Get /owners/{owner_key}/imports
OwnerAPI GetOwner Get /owners/{owner_key}
OwnerAPI GetOwnerContentAccess Get /owners/{owner_key}/content_access
OwnerAPI GetOwnerInfo Get /owners/{owner_key}/info
OwnerAPI GetOwnerSubscriptions Get /owners/{owner_key}/subscriptions
OwnerAPI GetSyspurpose Get /owners/{owner_key}/system_purpose
OwnerAPI GetUeberCertificate Get /owners/{owner_key}/uebercert
OwnerAPI GetUpstreamConsumers Get /owners/{owner_key}/upstream_consumers
OwnerAPI HealEntire Post /owners/{owner_key}/entitlements
OwnerAPI ImportManifestAsync Post /owners/{owner_key}/imports/async
OwnerAPI ListConsumers Get /owners/{owner_key}/consumers
OwnerAPI ListEnvironments Get /owners/{owner_key}/environments
OwnerAPI ListOwnerPools Get /owners/{owner_key}/pools
OwnerAPI ListOwners Get /owners
OwnerAPI OwnerActivationKeys Get /owners/{owner_key}/activation_keys
OwnerAPI OwnerEntitlements Get /owners/{owner_key}/entitlements
OwnerAPI OwnerServiceLevels Get /owners/{owner_key}/servicelevels
OwnerAPI RefreshPools Put /owners/{owner_key}/subscriptions
OwnerAPI SetLogLevel Put /owners/{owner_key}/log
OwnerAPI UndoImports Delete /owners/{owner_key}/imports
OwnerAPI UpdateOwner Put /owners/{owner_key}
OwnerAPI UpdatePool Put /owners/{owner_key}/pools
OwnerContentAPI CreateContent Post /owners/{owner_key}/content
OwnerContentAPI CreateContentBatch Post /owners/{owner_key}/content/batch
OwnerContentAPI GetContentById Get /owners/{owner_key}/content/{content_id}
OwnerContentAPI GetContentsByOwner Get /owners/{owner_key}/content
OwnerContentAPI RemoveContent Delete /owners/{owner_key}/content/{content_id}
OwnerContentAPI UpdateContent Put /owners/{owner_key}/content/{content_id}
OwnerProductAPI AddContentToProduct Post /owners/{owner_key}/products/{product_id}/content/{content_id}
OwnerProductAPI AddContentsToProduct Post /owners/{owner_key}/products/{product_id}/batch_content
OwnerProductAPI CreateProduct Post /owners/{owner_key}/products
OwnerProductAPI GetProductById Get /owners/{owner_key}/products/{product_id}
OwnerProductAPI GetProductCertificateById Get /owners/{owner_key}/products/{product_id}/certificate
OwnerProductAPI GetProductsByOwner Get /owners/{owner_key}/products
OwnerProductAPI RefreshPoolsForProduct Put /owners/{owner_key}/products/{product_id}/subscriptions
OwnerProductAPI RemoveContentFromProduct Delete /owners/{owner_key}/products/{product_id}/content/{content_id}
OwnerProductAPI RemoveContentsFromProduct Delete /owners/{owner_key}/products/{product_id}/batch_content
OwnerProductAPI RemoveProduct Delete /owners/{owner_key}/products/{product_id}
OwnerProductAPI UpdateProduct Put /owners/{owner_key}/products/{product_id}
PoolsAPI DeletePool Delete /pools/{pool_id}
PoolsAPI GetPool Get /pools/{pool_id}
PoolsAPI GetPoolCdn Get /pools/{pool_id}/cdn
PoolsAPI GetPoolEntitlements Get /pools/{pool_id}/entitlements
PoolsAPI GetSubCert Get /pools/{pool_id}/cert
PoolsAPI ListEntitledConsumerUuids Get /pools/{pool_id}/entitlements/consumer_uuids
PoolsAPI ListPools Get /pools
ProductsAPI GetProductByUuid Get /products/{product_uuid}
ProductsAPI GetProducts Get /products
ProductsAPI RefreshPoolsForProducts Put /products/subscriptions
RolesAPI AddRolePermission Post /roles/{role_name}/permissions
RolesAPI AddUserToRole Post /roles/{role_name}/users/{username}
RolesAPI CreateRole Post /roles
RolesAPI DeleteRoleByName Delete /roles/{role_name}
RolesAPI DeleteUserFromRole Delete /roles/{role_name}/users/{username}
RolesAPI GetRoleByName Get /roles/{role_name}
RolesAPI GetRoles Get /roles
RolesAPI RemoveRolePermission Delete /roles/{role_name}/permissions/{perm_id}
RolesAPI UpdateRole Put /roles/{role_name}
RootAPI GetRootResources Get /
RulesAPI GetRules Get /rules
StatusAPI Status Get /status
SubscriptionAPI ActivateSubscription Post /subscriptions
SubscriptionAPI DeleteSubscription Delete /subscriptions/{id}
SubscriptionAPI GetSubscriptions Get /subscriptions
UsersAPI CreateUser Post /users
UsersAPI DeleteUser Delete /users/{username}
UsersAPI GetUserInfo Get /users/{username}
UsersAPI GetUserRoles Get /users/{username}/roles
UsersAPI ListUserOwners Get /users/{username}/owners
UsersAPI ListUsers Get /users
UsersAPI UpdateUser Put /users/{username}

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

basicAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), caliri.ContextBasicAuth, caliri.BasicAuth{
	UserName: "username",
	Password: "password",
})
r, err := client.Service.Operation(auth, args)

ActivationKey

  • Type: API key
  • API key parameter name: activation-key
  • Location: URL query string

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

Example

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

ActivationKeyOwner

  • Type: API key
  • API key parameter name: owner
  • Location: URL query string

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

Example

auth := context.WithValue(
		context.Background(),
		caliri.ContextAPIKeys,
		map[string]caliri.APIKey{
			"ActivationKeyOwner": {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