Documentation ¶
Index ¶
- Constants
- Variables
- func GetTestServiceClientCentralConfiguration(client *ServiceClient) *corecfg.CentralConfiguration
- func WithKafkaPublishOperationBinding(useGroupID, useClientID bool) asyncAPIChannelOpts
- func WithKafkaSubscribeOperationBinding(useGroupID, useClientID bool) asyncAPIChannelOpts
- type APIError
- type APIKeyInfo
- type APIKeySecurityBuilder
- type APIServerInfo
- type APIServerInfoProperty
- type APIServiceRevisionTitle
- type AsyncAPIBuilder
- type AsyncAPIServerOpts
- type AsyncSpecProcessor
- type BearerSecurityBuilder
- type Client
- type DataplaneType
- type EndpointDefinition
- type HTTPBasicSecurityBuilder
- type OAuthFlowBuilder
- type OAuthSecurityBuilder
- type OasSpecProcessor
- type OpenIDSecurityBuilder
- type ResponseError
- type SecurityBuilder
- type ServiceBody
- func (s *ServiceBody) GetAPIKeyInfo() []APIKeyInfo
- func (s *ServiceBody) GetAccessRequestDefinition() *management.AccessRequestDefinition
- func (s *ServiceBody) GetAuthPolicies() []string
- func (s *ServiceBody) GetCredentialRequestDefinitions(allowedOAuthMethods []string) []string
- func (s *ServiceBody) GetDataplaneType() DataplaneType
- func (s *ServiceBody) GetReferenceInstanceName() string
- func (s *ServiceBody) GetReferencedServiceName() string
- func (s *ServiceBody) GetScopes() map[string]string
- func (s *ServiceBody) GetSpecVersion() string
- func (s *ServiceBody) IsDesignDataplane() bool
- func (s *ServiceBody) SetAccessRequestDefinitionName(ardName string, isUnique bool)
- func (s *ServiceBody) SetIgnoreSpecBasedCreds(ignore bool)
- type ServiceBuilder
- type ServiceClient
- func (c *ServiceClient) CreateAccessControlList(acl *management.AccessControlList) (*management.AccessControlList, error)
- func (c *ServiceClient) CreateOrUpdateResource(data apiv1.Interface) (*apiv1.ResourceInstance, error)
- func (c *ServiceClient) CreateResource(url string, bts []byte) (*apiv1.ResourceInstance, error)
- func (c *ServiceClient) CreateResourceInstance(ri apiv1.Interface) (*apiv1.ResourceInstance, error)
- func (c *ServiceClient) CreateSubResource(rm apiv1.ResourceMeta, subs map[string]interface{}) error
- func (c *ServiceClient) DeleteAPIServiceInstance(name string) error
- func (c *ServiceClient) DeleteResourceInstance(ri apiv1.Interface) error
- func (c *ServiceClient) DeleteServiceByName(name string) error
- func (c *ServiceClient) ExecuteAPI(method, url string, query map[string]string, buffer []byte) ([]byte, error)
- func (c *ServiceClient) ExecuteAPIWithHeader(method, url string, query map[string]string, buffer []byte, ...) ([]byte, error)
- func (c *ServiceClient) GetAPIRevisionByName(name string) (*management.APIServiceRevision, error)
- func (c *ServiceClient) GetAPIRevisions(query map[string]string, stage string) ([]*management.APIServiceRevision, error)
- func (c *ServiceClient) GetAPIServiceByName(name string) (*management.APIService, error)
- func (c *ServiceClient) GetAPIServiceInstanceByName(name string) (*management.APIServiceInstance, error)
- func (c *ServiceClient) GetAPIServiceInstances(queryParams map[string]string, URL string) ([]*management.APIServiceInstance, error)
- func (c *ServiceClient) GetAPIServiceRevisions(queryParams map[string]string, URL, stage string) ([]*management.APIServiceRevision, error)
- func (c *ServiceClient) GetAPIV1ResourceInstances(queryParams map[string]string, url string) ([]*apiv1.ResourceInstance, error)
- func (c *ServiceClient) GetAPIV1ResourceInstancesWithPageSize(queryParams map[string]string, url string, pageSize int) ([]*apiv1.ResourceInstance, error)
- func (c *ServiceClient) GetAccessControlList(name string) (*management.AccessControlList, error)
- func (c *ServiceClient) GetCentralTeamByName(name string) (*defs.PlatformTeam, error)
- func (c *ServiceClient) GetEnvironment() (*management.Environment, error)
- func (c *ServiceClient) GetResource(url string) (*apiv1.ResourceInstance, error)
- func (c *ServiceClient) GetResources(iface apiv1.Interface) ([]apiv1.Interface, error)
- func (c *ServiceClient) GetTeam(query map[string]string) ([]defs.PlatformTeam, error)
- func (c *ServiceClient) GetUserEmailAddress(id string) (string, error)
- func (c *ServiceClient) GetUserName(id string) (string, error)
- func (c *ServiceClient) Healthcheck(_ string) *hc.Status
- func (c *ServiceClient) PatchSubResource(ri apiv1.Interface, subResourceName string, patches []map[string]interface{}) (*apiv1.ResourceInstance, error)
- func (c *ServiceClient) PublishService(serviceBody *ServiceBody) (*management.APIService, error)
- func (c *ServiceClient) SetConfig(cfg corecfg.CentralConfig)
- func (c *ServiceClient) SetTokenGetter(tokenRequester auth.PlatformTokenGetter)
- func (c *ServiceClient) UpdateAccessControlList(acl *management.AccessControlList) (*management.AccessControlList, error)
- func (c *ServiceClient) UpdateResource(url string, bts []byte) (*apiv1.ResourceInstance, error)
- func (c *ServiceClient) UpdateResourceFinalizer(res *apiv1.ResourceInstance, finalizer, description string, addAction bool) (*apiv1.ResourceInstance, error)
- func (c *ServiceClient) UpdateResourceInstance(ri apiv1.Interface) (*apiv1.ResourceInstance, error)
- type SpecProcessor
- type SpecResourceParser
- type UnstructuredProperties
Constants ¶
const ( Apikey = "verify-api-key" Passthrough = "pass-through" Oauth = "verify-oauth-token" Basic = "http-basic" )
constants for auth policy types
const ( PatchOpAdd = "add" PatchOpReplace = "replace" PatchOpDelete = "delete" PatchOpBuildObjectTree = "x-build-object-tree" PatchOperation = "op" PatchPath = "path" PatchValue = "value" ContentTypeJsonPatch = "application/json-patch+json" ContentTypeJson = "application/json" )
constants for patch request
const ( BearerTokenPrefix = "Bearer " HdrContentType = "Content-Type" HdrAuthorization = "Authorization" HdrAxwayTenantID = "X-Axway-Tenant-Id" )
constants for patch request
const ( API = "API" Wsdl = "wsdl" SwaggerV2 = "swaggerv2" Oas2 = "oas2" Oas3 = "oas3" Protobuf = "protobuf" AsyncAPI = "asyncapi" Unstructured = "unstructured" Specification = "specification" Swagger = "swagger" GraphQL = "graphql-sdl" Raml = "RAML" SubscriptionSchemaNameSuffix = ".authsubscription" DefaultSubscriptionWebhookName = "subscriptionwebhook" DefaultSubscriptionWebhookAuthKey = "webhookAuthKey" FieldsKey = "fields" QueryKey = "query" CreateTimestampQueryKey = "metadata.audit.createTimestamp" DefaultTeamKey = "DefaultTeam" )
Various consts for use
const ( UnpublishedState = "UNPUBLISHED" PublishedState = "PUBLISHED" ApprovalPendingState = "PENDING" )
consts for state
const ( DeprecatedStatus = "DEPRECATED" PublishedStatus = "PUBLISHED" UnpublishedStatus = "UNPUBLISHED" UnidentifiedInboundPolicy = "UNIDENTIFIED INBOUND POLICY" )
consts for status
const ( MajorChange = "MAJOR" MinorChange = "MINOR" )
consts for update serverity
const ( Raml08 = "RAML 0.8" Raml10 = "RAML 1.0" )
consts for RAML versions
const (
TeamMapKey = "TeamMap"
)
other consts
const (
UnknownYamlJson = "unknown yaml or json based specification"
)
Variables ¶
var ( ErrCentralConfig = errors.New(1100, "configuration error for Amplify Central") ErrEnvironmentQuery = errors.New(1101, "error sending request to Amplify Central. Check configuration for CENTRAL_ENVIRONMENT") ErrTeamNotFound = errors.Newf(1102, "could not find team (%s) in Amplify Central. Check configuration for CENTRAL_TEAM") ErrNetwork = errors.New(1110, "error connecting to Amplify Central. Check docs.axway.com for more info on this error code") ErrRequestQuery = errors.New(1120, "error making a request to Amplify") ErrAuthenticationCall = errors.New(1130, "error getting authentication token. Check Amplify Central auth configuration (CENTRAL_AUTH_*) and network configuration for agent on docs.axway.com") ErrAuthentication = errors.New(1131, "authentication token was not valid. Check Amplify Central auth configuration (CENTRAL_AUTH_*)") )
Errors hit when validating Amplify Central connectivity
var ( ErrNoAddressFound = errors.Newf(1139, "could not find the subscriber (%s) email address") // Service body builder ErrSetSpecEndPoints = errors.New(1160, "error getting endpoints for the API specification") )
Errors hit when calling different Amplify APIs
var MockTokenGetter = &mockTokenGetter{}
MockTokenGetter - global var for use in unit tests to return a fake token
var ValidPolicies = []string{Apikey, Passthrough, Oauth, Basic}
ValidPolicies - list of valid auth policies supported by Central. Add to this list as more policies are supported.
Functions ¶
func GetTestServiceClientCentralConfiguration ¶
func GetTestServiceClientCentralConfiguration(client *ServiceClient) *corecfg.CentralConfiguration
GetTestServiceClientCentralConfiguration - cast and return the CentralConfiguration
func WithKafkaPublishOperationBinding ¶ added in v1.1.92
func WithKafkaPublishOperationBinding(useGroupID, useClientID bool) asyncAPIChannelOpts
func WithKafkaSubscribeOperationBinding ¶ added in v1.1.92
func WithKafkaSubscribeOperationBinding(useGroupID, useClientID bool) asyncAPIChannelOpts
Types ¶
type APIError ¶
type APIError struct { Status int `json:"status,omitempty"` Title string `json:"title,omitempty"` Detail string `json:"detail,omitempty"` }
APIError - api response error
type APIKeySecurityBuilder ¶ added in v1.1.75
type APIKeySecurityBuilder interface { Build() map[string]interface{} InCookie() APIKeySecurityBuilder // quests are the same for cookie vs api key in query or header InHeader() APIKeySecurityBuilder InQueryParam() APIKeySecurityBuilder SetArgumentName(argName string) APIKeySecurityBuilder }
type APIServerInfo ¶
type APIServerInfo struct {
Environment APIServerInfoProperty `json:"environment,omitempty"`
}
APIServerInfo -
type APIServerInfoProperty ¶
type APIServerInfoProperty struct { Name string `json:"name,omitempty"` ID string `json:"id,omitempty"` }
APIServerInfoProperty -
type APIServiceRevisionTitle ¶
type APIServiceRevisionTitle struct { APIServiceName string Date string Revision string StageLabel string Stage string }
APIServiceRevisionTitle - apiservicerevision template for title
type AsyncAPIBuilder ¶ added in v1.1.92
type AsyncAPIBuilder interface { AddServer(name, description, url string, opts ...AsyncAPIServerOpts) AsyncAPIBuilder AddChannel(name, description string, opts ...asyncAPIChannelOpts) AsyncAPIBuilder SetPublishMessageRef(channelName, componentMessage string) AsyncAPIBuilder SetSubscribeMessageRef(channelName, componentMessage string) AsyncAPIBuilder AddComponentMessage(msgName, schemaFormat, contentType string, payload map[string]interface{}) AsyncAPIBuilder Build(id, title, description, version string) (AsyncSpecProcessor, error) }
func CreateAsyncAPIBuilder ¶ added in v1.1.92
func CreateAsyncAPIBuilder() AsyncAPIBuilder
type AsyncAPIServerOpts ¶ added in v1.1.92
type AsyncAPIServerOpts func(*asyncAPIBuilder, *spec.Server)
func WithProtocol ¶ added in v1.1.92
func WithProtocol(protocol, protocolVersion string) AsyncAPIServerOpts
func WithSaslPlainSecurity ¶ added in v1.1.92
func WithSaslPlainSecurity(description string) AsyncAPIServerOpts
func WithSaslScramSecurity ¶ added in v1.1.92
func WithSaslScramSecurity(scramMechanism, description string) AsyncAPIServerOpts
type AsyncSpecProcessor ¶ added in v1.1.92
type AsyncSpecProcessor interface { GetID() string GetTitle() string GetVersion() string GetEndpoints() ([]management.ApiServiceInstanceSpecEndpoint, error) GetResourceType() string GetSpecBytes() []byte }
type BearerSecurityBuilder ¶ added in v1.1.75
type BearerSecurityBuilder interface { Build() map[string]interface{} SetFormat(format string) BearerSecurityBuilder }
type Client ¶
type Client interface { SetTokenGetter(tokenRequester auth.PlatformTokenGetter) SetConfig(cfg corecfg.CentralConfig) PublishService(serviceBody *ServiceBody) (*management.APIService, error) DeleteAPIServiceInstance(name string) error DeleteServiceByName(name string) error GetUserEmailAddress(ID string) (string, error) GetUserName(ID string) (string, error) ExecuteAPI(method, url string, queryParam map[string]string, buffer []byte) ([]byte, error) Healthcheck(name string) *hc.Status GetAPIRevisions(query map[string]string, stage string) ([]*management.APIServiceRevision, error) GetAPIServiceRevisions(query map[string]string, URL, stage string) ([]*management.APIServiceRevision, error) GetAPIServiceInstances(query map[string]string, URL string) ([]*management.APIServiceInstance, error) GetAPIV1ResourceInstances(query map[string]string, URL string) ([]*apiv1.ResourceInstance, error) GetAPIV1ResourceInstancesWithPageSize(query map[string]string, URL string, pageSize int) ([]*apiv1.ResourceInstance, error) GetAPIServiceByName(name string) (*management.APIService, error) GetAPIServiceInstanceByName(name string) (*management.APIServiceInstance, error) GetAPIRevisionByName(name string) (*management.APIServiceRevision, error) GetEnvironment() (*management.Environment, error) GetCentralTeamByName(name string) (*defs.PlatformTeam, error) GetTeam(query map[string]string) ([]defs.PlatformTeam, error) GetAccessControlList(aclName string) (*management.AccessControlList, error) UpdateAccessControlList(acl *management.AccessControlList) (*management.AccessControlList, error) CreateAccessControlList(acl *management.AccessControlList) (*management.AccessControlList, error) CreateSubResource(rm apiv1.ResourceMeta, subs map[string]interface{}) error GetResource(url string) (*apiv1.ResourceInstance, error) UpdateResourceFinalizer(ri *apiv1.ResourceInstance, finalizer, description string, addAction bool) (*apiv1.ResourceInstance, error) UpdateResourceInstance(ri apiv1.Interface) (*apiv1.ResourceInstance, error) CreateOrUpdateResource(ri apiv1.Interface) (*apiv1.ResourceInstance, error) CreateResourceInstance(ri apiv1.Interface) (*apiv1.ResourceInstance, error) PatchSubResource(ri apiv1.Interface, subResourceName string, patches []map[string]interface{}) (*apiv1.ResourceInstance, error) DeleteResourceInstance(ri apiv1.Interface) error GetResources(ri apiv1.Interface) ([]apiv1.Interface, error) CreateResource(url string, bts []byte) (*apiv1.ResourceInstance, error) UpdateResource(url string, bts []byte) (*apiv1.ResourceInstance, error) }
Client - interface
func New ¶
func New(cfg corecfg.CentralConfig, tokenRequester auth.PlatformTokenGetter, caches cache2.Manager) Client
New creates a new Client
type DataplaneType ¶ added in v1.1.79
type DataplaneType string
consts for dataplane type
const ( // Discovery only GitHub DataplaneType = "GitHub" GitLab DataplaneType = "GitLab" SwaggerHub DataplaneType = "SwaggerHub" Backstage DataplaneType = "Backstage" // Discovery and Traceability APIConnect DataplaneType = "APIConnect" Apigee DataplaneType = "Apigee" APIM DataplaneType = "APIM" AWS DataplaneType = "AWS" Azure DataplaneType = "Azure" Istio DataplaneType = "Istio" // Reports as APIMG Kafka DataplaneType = "Kafka" WebMethods DataplaneType = "WebMethods" // AgentSDK Metrics Kong DataplaneType = "Kong" Mulesoft DataplaneType = "Mulesoft" // Compliance Graylog DataplaneType = "Graylog" Traceable DataplaneType = "Traceable" // Other Unclassified DataplaneType = "Unclassified" Unidentified DataplaneType = "Unidentified" )
func (DataplaneType) String ¶ added in v1.1.79
func (t DataplaneType) String() string
type EndpointDefinition ¶
type EndpointDefinition struct { Host string Port int32 Protocol string BasePath string Details map[string]interface{} }
EndpointDefinition - holds the service endpoint definition
type HTTPBasicSecurityBuilder ¶ added in v1.1.75
type HTTPBasicSecurityBuilder interface {
Build() map[string]interface{}
}
type OAuthFlowBuilder ¶ added in v1.1.75
type OAuthFlowBuilder interface { SetScopes(map[string]string) OAuthFlowBuilder AddScope(scope, description string) OAuthFlowBuilder SetAuthorizationURL(url string) OAuthFlowBuilder SetRefreshURL(url string) OAuthFlowBuilder SetTokenURL(url string) OAuthFlowBuilder Implicit() *oAuthFlow Password() *oAuthFlow AuthorizationCode() *oAuthFlow ClientCredentials() *oAuthFlow }
oauth flow options, setting flow type should be last, not all other methods are required
func NewOAuthFlowBuilder ¶ added in v1.1.75
func NewOAuthFlowBuilder() OAuthFlowBuilder
type OAuthSecurityBuilder ¶ added in v1.1.75
type OAuthSecurityBuilder interface { AddFlow(flow *oAuthFlow) OAuthSecurityBuilder Build() map[string]interface{} }
type OasSpecProcessor ¶
type OasSpecProcessor interface { ParseAuthInfo() GetAPIKeyInfo() []APIKeyInfo GetOAuthScopes() map[string]string GetAuthPolicies() []string StripSpecAuth() GetTitle() string GetSecurityBuilder() SecurityBuilder AddSecuritySchemes(map[string]interface{}) }
OasSpecProcessor -
type OpenIDSecurityBuilder ¶ added in v1.1.75
type OpenIDSecurityBuilder interface { Build() map[string]interface{} SetURL(url string) OpenIDSecurityBuilder }
type ResponseError ¶
type ResponseError struct {
Errors []APIError `json:"errors,omitempty"`
}
ResponseError - api response errors
type SecurityBuilder ¶ added in v1.1.75
type SecurityBuilder interface { HTTPBasic() HTTPBasicSecurityBuilder APIKey() APIKeySecurityBuilder OAuth() OAuthSecurityBuilder Bearer() BearerSecurityBuilder OpenID() OpenIDSecurityBuilder }
first select the type of security we are building
type ServiceBody ¶
type ServiceBody struct { NameToPush string APIName string RestAPIID string PrimaryKey string URL string Stage string StageDescriptor string StageDisplayName string Description string Version string AuthPolicy string SpecDefinition []byte Documentation []byte Tags map[string]interface{} Image string ImageContentType string CreatedBy string ResourceContentType string ResourceType string SubscriptionName string APIUpdateSeverity string State string Status string ServiceAttributes map[string]string RevisionAttributes map[string]string InstanceAttributes map[string]string ServiceAgentDetails map[string]interface{} InstanceAgentDetails map[string]interface{} RevisionAgentDetails map[string]interface{} Endpoints []EndpointDefinition UnstructuredProps *UnstructuredProperties TeamName string // contains filtered or unexported fields }
ServiceBody - details about a service to create
func (*ServiceBody) GetAPIKeyInfo ¶
func (s *ServiceBody) GetAPIKeyInfo() []APIKeyInfo
GetAPIKeyInfo - returns the array of locations and argument names for the api key
func (*ServiceBody) GetAccessRequestDefinition ¶
func (s *ServiceBody) GetAccessRequestDefinition() *management.AccessRequestDefinition
GetAccessRequestDefinition -
func (*ServiceBody) GetAuthPolicies ¶
func (s *ServiceBody) GetAuthPolicies() []string
GetAuthPolicies - returns the array of all auth policies in the ServiceBody
func (*ServiceBody) GetCredentialRequestDefinitions ¶
func (s *ServiceBody) GetCredentialRequestDefinitions(allowedOAuthMethods []string) []string
GetCredentialRequestDefinitions - returns the array of all credential request policies
func (*ServiceBody) GetDataplaneType ¶ added in v1.1.79
func (s *ServiceBody) GetDataplaneType() DataplaneType
GetDataplaneType - returns dataplane type
func (*ServiceBody) GetReferenceInstanceName ¶ added in v1.1.79
func (s *ServiceBody) GetReferenceInstanceName() string
func (*ServiceBody) GetReferencedServiceName ¶ added in v1.1.79
func (s *ServiceBody) GetReferencedServiceName() string
func (*ServiceBody) GetScopes ¶
func (s *ServiceBody) GetScopes() map[string]string
GetScopes - returns the array of scopes for this service instance
func (*ServiceBody) GetSpecVersion ¶ added in v1.1.57
func (s *ServiceBody) GetSpecVersion() string
GetSpecVersion - returns version parsed from the spec
func (*ServiceBody) IsDesignDataplane ¶ added in v1.1.79
func (s *ServiceBody) IsDesignDataplane() bool
IsDesignDataplane - returns true for design dataplane
func (*ServiceBody) SetAccessRequestDefinitionName ¶
func (s *ServiceBody) SetAccessRequestDefinitionName(ardName string, isUnique bool)
SetAccessRequestDefinitionName - set the name of the access request definition for this service body
func (*ServiceBody) SetIgnoreSpecBasedCreds ¶ added in v1.1.95
func (s *ServiceBody) SetIgnoreSpecBasedCreds(ignore bool)
type ServiceBuilder ¶
type ServiceBuilder interface { SetID(ID string) ServiceBuilder SetPrimaryKey(key string) ServiceBuilder SetRequestDefinitionsAllowed(previouslyPublished bool) ServiceBuilder SetTitle(title string) ServiceBuilder SetAPIName(apiName string) ServiceBuilder SetURL(url string) ServiceBuilder SetStage(stage string) ServiceBuilder SetStageDescriptor(stageDescriptor string) ServiceBuilder SetStageDisplayName(stageName string) ServiceBuilder SetDescription(description string) ServiceBuilder SetVersion(version string) ServiceBuilder SetAuthPolicy(authPolicy string) ServiceBuilder SetAPISpec(spec []byte) ServiceBuilder SetDocumentation(documentation []byte) ServiceBuilder SetTags(tags map[string]interface{}) ServiceBuilder SetImage(image string) ServiceBuilder SetImageContentType(imageContentType string) ServiceBuilder SetResourceType(resourceType string) ServiceBuilder SetSubscriptionName(subscriptionName string) ServiceBuilder SetAPIUpdateSeverity(apiUpdateSeverity string) ServiceBuilder SetState(state string) ServiceBuilder SetStatus(status string) ServiceBuilder SetServiceAttribute(serviceAttribute map[string]string) ServiceBuilder SetInstanceAttribute(instanceAttribute map[string]string) ServiceBuilder SetRevisionAttribute(revisionAttribute map[string]string) ServiceBuilder SetServiceEndpoints(endpoints []EndpointDefinition) ServiceBuilder AddServiceEndpoint(protocol, host string, port int32, basePath string) ServiceBuilder SetCredentialRequestDefinitions(credentialRequestDefNames []string) ServiceBuilder AddCredentialRequestDefinition(credentialRequestDefName string) ServiceBuilder SetAccessRequestDefinitionName(accessRequestDefName string, isUnique bool) ServiceBuilder SetIgnoreSpecBasedCreds(ignore bool) ServiceBuilder SetUnstructuredType(assetType string) ServiceBuilder SetUnstructuredContentType(contentType string) ServiceBuilder SetUnstructuredLabel(label string) ServiceBuilder SetUnstructuredFilename(filename string) ServiceBuilder SetTeamName(teamName string) ServiceBuilder SetServiceAgentDetails(attr map[string]interface{}) ServiceBuilder SetInstanceAgentDetails(attr map[string]interface{}) ServiceBuilder SetRevisionAgentDetails(attr map[string]interface{}) ServiceBuilder SetSourceDataplaneType(dataplaneType DataplaneType, isDesign bool) ServiceBuilder SetReferenceServiceName(serviceName, envName string) ServiceBuilder SetReferenceInstanceName(instanceName, envName string) ServiceBuilder Build() (ServiceBody, error) }
ServiceBuilder - Interface to build the service body
func NewServiceBodyBuilder ¶
func NewServiceBodyBuilder() ServiceBuilder
NewServiceBodyBuilder - Creates a new service body builder
type ServiceClient ¶
type ServiceClient struct { DefaultSubscriptionApprovalWebhook corecfg.WebhookConfig // contains filtered or unexported fields }
ServiceClient -
func GetTestServiceClient ¶
func GetTestServiceClient() (*ServiceClient, *api.MockHTTPClient)
GetTestServiceClient - return a true ServiceClient, but with mocks for tokengetter and the HTTPClient and dummy values for various configurations. Has enough other configuration to make the client usable. This function also returns the MockHTTPClient so the caller can use it directly if needed, as it is not available directly from ServiceClient in other packages
func (*ServiceClient) CreateAccessControlList ¶
func (c *ServiceClient) CreateAccessControlList(acl *management.AccessControlList) (*management.AccessControlList, error)
CreateAccessControlList -
func (*ServiceClient) CreateOrUpdateResource ¶
func (c *ServiceClient) CreateOrUpdateResource(data apiv1.Interface) (*apiv1.ResourceInstance, error)
CreateOrUpdateResource deletes a resource
func (*ServiceClient) CreateResource ¶
func (c *ServiceClient) CreateResource(url string, bts []byte) (*apiv1.ResourceInstance, error)
CreateResource deletes a resource
func (*ServiceClient) CreateResourceInstance ¶
func (c *ServiceClient) CreateResourceInstance(ri apiv1.Interface) (*apiv1.ResourceInstance, error)
CreateResourceInstance - creates a ResourceInstance
func (*ServiceClient) CreateSubResource ¶
func (c *ServiceClient) CreateSubResource(rm apiv1.ResourceMeta, subs map[string]interface{}) error
CreateSubResource creates a sub resource on the provided resource.
func (*ServiceClient) DeleteAPIServiceInstance ¶
func (c *ServiceClient) DeleteAPIServiceInstance(name string) error
DeleteAPIServiceInstance deletes an api service instance in central by name
func (*ServiceClient) DeleteResourceInstance ¶
func (c *ServiceClient) DeleteResourceInstance(ri apiv1.Interface) error
DeleteResourceInstance - deletes a ResourceInstance
func (*ServiceClient) DeleteServiceByName ¶
func (c *ServiceClient) DeleteServiceByName(name string) error
DeleteServiceByName -
func (*ServiceClient) ExecuteAPI ¶
func (c *ServiceClient) ExecuteAPI(method, url string, query map[string]string, buffer []byte) ([]byte, error)
ExecuteAPI - execute the api
func (*ServiceClient) ExecuteAPIWithHeader ¶ added in v1.1.79
func (c *ServiceClient) ExecuteAPIWithHeader(method, url string, query map[string]string, buffer []byte, headers map[string]string) ([]byte, error)
ExecuteAPI - execute the api
func (*ServiceClient) GetAPIRevisionByName ¶
func (c *ServiceClient) GetAPIRevisionByName(name string) (*management.APIServiceRevision, error)
GetAPIRevisionByName - Returns the API revision based on its revision name
func (*ServiceClient) GetAPIRevisions ¶
func (c *ServiceClient) GetAPIRevisions(query map[string]string, stage string) ([]*management.APIServiceRevision, error)
GetAPIRevisions - Returns the list of API revisions for the specified filter NOTE : this function can go away. You can call GetAPIServiceRevisions directly from your function to get []*management.APIServiceRevision
func (*ServiceClient) GetAPIServiceByName ¶
func (c *ServiceClient) GetAPIServiceByName(name string) (*management.APIService, error)
GetAPIServiceByName - Returns the API service based on its name
func (*ServiceClient) GetAPIServiceInstanceByName ¶
func (c *ServiceClient) GetAPIServiceInstanceByName(name string) (*management.APIServiceInstance, error)
GetAPIServiceInstanceByName - Returns the API service instance for specified name
func (*ServiceClient) GetAPIServiceInstances ¶
func (c *ServiceClient) GetAPIServiceInstances(queryParams map[string]string, URL string) ([]*management.APIServiceInstance, error)
GetAPIServiceInstances - get management.APIServiceInstance
func (*ServiceClient) GetAPIServiceRevisions ¶
func (c *ServiceClient) GetAPIServiceRevisions(queryParams map[string]string, URL, stage string) ([]*management.APIServiceRevision, error)
GetAPIServiceRevisions - management.APIServiceRevision
func (*ServiceClient) GetAPIV1ResourceInstances ¶
func (c *ServiceClient) GetAPIV1ResourceInstances(queryParams map[string]string, url string) ([]*apiv1.ResourceInstance, error)
GetAPIV1ResourceInstances - return apiv1 Resource instance with the default page size
func (*ServiceClient) GetAPIV1ResourceInstancesWithPageSize ¶
func (c *ServiceClient) GetAPIV1ResourceInstancesWithPageSize(queryParams map[string]string, url string, pageSize int) ([]*apiv1.ResourceInstance, error)
GetAPIV1ResourceInstancesWithPageSize - return apiv1 Resource instance
func (*ServiceClient) GetAccessControlList ¶
func (c *ServiceClient) GetAccessControlList(name string) (*management.AccessControlList, error)
GetAccessControlList -
func (*ServiceClient) GetCentralTeamByName ¶
func (c *ServiceClient) GetCentralTeamByName(name string) (*defs.PlatformTeam, error)
GetCentralTeamByName - returns the team based on team name
func (*ServiceClient) GetEnvironment ¶
func (c *ServiceClient) GetEnvironment() (*management.Environment, error)
GetEnvironment get an environment
func (*ServiceClient) GetResource ¶
func (c *ServiceClient) GetResource(url string) (*apiv1.ResourceInstance, error)
GetResource gets a single resource
func (*ServiceClient) GetResources ¶ added in v1.1.33
GetResource gets a single resource
func (*ServiceClient) GetTeam ¶
func (c *ServiceClient) GetTeam(query map[string]string) ([]defs.PlatformTeam, error)
GetTeam - returns the team ID based on filter
func (*ServiceClient) GetUserEmailAddress ¶
func (c *ServiceClient) GetUserEmailAddress(id string) (string, error)
GetUserEmailAddress - request the user email
func (*ServiceClient) GetUserName ¶
func (c *ServiceClient) GetUserName(id string) (string, error)
GetUserName - request the user name
func (*ServiceClient) Healthcheck ¶
func (c *ServiceClient) Healthcheck(_ string) *hc.Status
Healthcheck - verify connection to the platform
func (*ServiceClient) PatchSubResource ¶ added in v1.1.79
func (c *ServiceClient) PatchSubResource(ri apiv1.Interface, subResourceName string, patches []map[string]interface{}) (*apiv1.ResourceInstance, error)
PatchSubResource - applies the patches to the sub-resource
func (*ServiceClient) PublishService ¶
func (c *ServiceClient) PublishService(serviceBody *ServiceBody) (*management.APIService, error)
PublishService - processes the API to create/update apiservice, revision, instance
func (*ServiceClient) SetConfig ¶
func (c *ServiceClient) SetConfig(cfg corecfg.CentralConfig)
SetConfig - sets the config and apiClient
func (*ServiceClient) SetTokenGetter ¶
func (c *ServiceClient) SetTokenGetter(tokenRequester auth.PlatformTokenGetter)
SetTokenGetter - sets the token getter
func (*ServiceClient) UpdateAccessControlList ¶
func (c *ServiceClient) UpdateAccessControlList(acl *management.AccessControlList) (*management.AccessControlList, error)
UpdateAccessControlList - removes existing then creates new AccessControlList
func (*ServiceClient) UpdateResource ¶
func (c *ServiceClient) UpdateResource(url string, bts []byte) (*apiv1.ResourceInstance, error)
UpdateResource updates a resource
func (*ServiceClient) UpdateResourceFinalizer ¶
func (c *ServiceClient) UpdateResourceFinalizer(res *apiv1.ResourceInstance, finalizer, description string, addAction bool) (*apiv1.ResourceInstance, error)
UpdateResourceFinalizer - Add or remove a finalizer from a resource
func (*ServiceClient) UpdateResourceInstance ¶
func (c *ServiceClient) UpdateResourceInstance(ri apiv1.Interface) (*apiv1.ResourceInstance, error)
UpdateResourceInstance - updates a ResourceInstance
type SpecProcessor ¶
type SpecProcessor interface { GetVersion() string GetEndpoints() ([]EndpointDefinition, error) GetDescription() string GetSpecBytes() []byte GetResourceType() string }
SpecProcessor -
type SpecResourceParser ¶
type SpecResourceParser struct {
// contains filtered or unexported fields
}
SpecResourceParser -
func NewSpecResourceParser ¶
func NewSpecResourceParser(resourceSpec []byte, resourceSpecType string) SpecResourceParser
NewSpecResourceParser -
func (*SpecResourceParser) GetSpecProcessor ¶
func (s *SpecResourceParser) GetSpecProcessor() SpecProcessor
GetSpecProcessor -
Source Files ¶
- apiservice.go
- apiserviceinstance.go
- apiservicerevision.go
- asyncapi.go
- asyncapibuilder.go
- client.go
- definitions.go
- errors.go
- mockserviceclient.go
- mocktokengetter.go
- resourcePagination.go
- service.go
- servicebody.go
- servicebuilder.go
- specasyncapiprocessor.go
- specgraphql.go
- specoas2processor.go
- specoas3processor.go
- specparser.go
- specprotobufprocessor.go
- specramlprocessor.go
- specsecuritybuilder.go
- specunstructuredprocessor.go
- specwsdlprocessor.go
- util.go
Directories ¶
Path | Synopsis |
---|---|
apiserver
|
|
Package auth implements the apic service account token management.
|
Package auth implements the apic service account token management. |
unifiedcatalog
|
|