servicemanager

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ErrInvalidSecretData = "BindingCredentials can't be created from invalid secret data"
View Source
const ServiceManagerOfferingName = "service-manager"

Variables

This section is empty.

Functions

This section is empty.

Types

type BindingCredentials

type BindingCredentials struct {
	Clientid     *string `json:"clientid,omitempty"`
	Clientsecret *string `json:"clientsecret,omitempty"`
	SmUrl        *string `json:"sm_url,omitempty"`
	Url          *string `json:"url,omitempty"`
	Xsappname    *string `json:"xsappname,omitempty"`
}

func NewCredsFromOperatorSecret

func NewCredsFromOperatorSecret(secretData map[string][]byte) (BindingCredentials, error)

NewCredsFromOperatorSecret creates a new BindingCredentials from a secret data of a btp service operator secret, which is slightly different in structure then the creds of a regular servicebinding

type Defaults

type Defaults struct {
	InstanceName string `json:"instanceName,omitempty"`
	BindingName  string `json:"bindingName,omitempty"`
}

type ITfClient

type ITfClient interface {
	ObserveResources(ctx context.Context, cr *apisv1beta1.ServiceManager) (ResourcesStatus, error)
	CreateResources(ctx context.Context, cr *apisv1beta1.ServiceManager) (string, string, error)
	UpdateResources(ctx context.Context, cr *apisv1beta1.ServiceManager) error
	DeleteResources(ctx context.Context, cr *apisv1beta1.ServiceManager) error
}

ITfClient contains domain logic for managing ServiceManager lifecycle

type ITfClientInitializer

type ITfClientInitializer interface {
	ConnectResources(ctx context.Context, cr *apisv1beta1.ServiceManager) (ITfClient, error)
}

ITfClientInitializer will produce the ITfClient used by external

type PlanIdResolver

type PlanIdResolver interface {
	PlanIDByName(ctx context.Context, offeringName string, servicePlanName string) (string, error)
}

PlanIdResolver used as its own resolval implementation downstream

type ResourcesStatus

type ResourcesStatus struct {
	managed.ExternalObservation
	InstanceID string
	BindingID  string
}

ResourcesStatus contains a summary of the status of the tf resources managed by the ITfClient it uses the crossplane terminology for the external observation and enhances it with IDs of the managed instances

type ServiceManagerClient

type ServiceManagerClient struct {
	servicemanager.ServiceOfferingsAPI
	servicemanager.ServicePlansAPI
}

ServiceManagerClient is a client for looking up serviceplanID over the service manager API, it requires a service manager instance binding

func NewServiceManagerClient

func NewServiceManagerClient(ctx context.Context, creds *BindingCredentials) (*ServiceManagerClient, error)

func (*ServiceManagerClient) PlanIDByName

func (sm *ServiceManagerClient) PlanIDByName(ctx context.Context, offeringName, planName string) (string, error)

type ServiceManagerInstanceProxyClient

type ServiceManagerInstanceProxyClient struct {
	accountsserviceclient.SubaccountOperationsAPI
	// contains filtered or unexported fields
}

ServiceManagerInstanceProxyClient is a throw-away implementation, which retrieves a servicePlanID by - creating an intermediate subaccount-admin servicemanager instance via the accountsapi - looksup the servicePLanID via those created credentials binding - deletes this intermediate servicemanager instance -> THIS NEEDS TO BE REPLACED VIA TF DATASOURCES AS SOON AS THOSE ARE AVAILABLE IN UPJET

func (ServiceManagerInstanceProxyClient) ServiceManagerPlanIDByName

func (t ServiceManagerInstanceProxyClient) ServiceManagerPlanIDByName(ctx context.Context, subaccountId string, servicePlanName string) (string, error)

type SubaccountServiceFake

type SubaccountServiceFake struct {
	CreateMockFn func() (*saops.ServiceManagerBindingResponseObject, *http.Response, error)
	GetMockFn    func() (*saops.ServiceManagerBindingResponseObject, *http.Response, error)
	DeleteMockFn func() (*http.Response, error)

	AdminBindingDeleteCalled bool
}

func (*SubaccountServiceFake) CloneNeoSubaccount

func (s *SubaccountServiceFake) CloneNeoSubaccount(ctx context.Context, sourceSubaccountGUID string) saops.ApiCloneNeoSubaccountRequest

func (*SubaccountServiceFake) CloneNeoSubaccountExecute

func (*SubaccountServiceFake) CreateOrUpdateSubaccountSettings

func (s *SubaccountServiceFake) CreateOrUpdateSubaccountSettings(ctx context.Context, subaccountGUID string) saops.ApiCreateOrUpdateSubaccountSettingsRequest

func (*SubaccountServiceFake) CreateOrUpdateSubaccountSettingsExecute

func (*SubaccountServiceFake) CreateServiceManagementBinding

func (s *SubaccountServiceFake) CreateServiceManagementBinding(ctx context.Context, subaccountGUID string) saops.ApiCreateServiceManagementBindingRequest

func (*SubaccountServiceFake) CreateServiceManagerBindingV2

func (s *SubaccountServiceFake) CreateServiceManagerBindingV2(ctx context.Context, subaccountGUID string) saops.ApiCreateServiceManagerBindingV2Request

func (*SubaccountServiceFake) CreateSubaccount

func (*SubaccountServiceFake) CreateSubaccountExecute

func (*SubaccountServiceFake) CreateSubaccountLabels

func (s *SubaccountServiceFake) CreateSubaccountLabels(ctx context.Context, subaccountGUID string) saops.ApiCreateSubaccountLabelsRequest

func (*SubaccountServiceFake) CreateSubaccountLabelsExecute

func (*SubaccountServiceFake) DeleteServiceManagementBindingOfSubaccount

func (s *SubaccountServiceFake) DeleteServiceManagementBindingOfSubaccount(ctx context.Context, subaccountGUID string) saops.ApiDeleteServiceManagementBindingOfSubaccountRequest

func (*SubaccountServiceFake) DeleteServiceManagementBindingOfSubaccountExecute

func (s *SubaccountServiceFake) DeleteServiceManagementBindingOfSubaccountExecute(r saops.ApiDeleteServiceManagementBindingOfSubaccountRequest) (*http.Response, error)

func (*SubaccountServiceFake) DeleteServiceManagerBindingV2

func (s *SubaccountServiceFake) DeleteServiceManagerBindingV2(ctx context.Context, subaccountGUID string, bindingName string) saops.ApiDeleteServiceManagerBindingV2Request

func (*SubaccountServiceFake) DeleteServiceManagerBindingV2Execute

func (s *SubaccountServiceFake) DeleteServiceManagerBindingV2Execute(r saops.ApiDeleteServiceManagerBindingV2Request) (*http.Response, error)

func (*SubaccountServiceFake) DeleteSubaccount

func (s *SubaccountServiceFake) DeleteSubaccount(ctx context.Context, subaccountGUID string) saops.ApiDeleteSubaccountRequest

func (*SubaccountServiceFake) DeleteSubaccountExecute

func (*SubaccountServiceFake) DeleteSubaccountLabels

func (s *SubaccountServiceFake) DeleteSubaccountLabels(ctx context.Context, subaccountGUID string) saops.ApiDeleteSubaccountLabelsRequest

func (*SubaccountServiceFake) DeleteSubaccountLabelsExecute

func (*SubaccountServiceFake) DeleteSubaccountSettings

func (s *SubaccountServiceFake) DeleteSubaccountSettings(ctx context.Context, subaccountGUID string) saops.ApiDeleteSubaccountSettingsRequest

func (*SubaccountServiceFake) DeleteSubaccountSettingsExecute

func (*SubaccountServiceFake) GetAllServiceManagerBindingsV2

func (s *SubaccountServiceFake) GetAllServiceManagerBindingsV2(ctx context.Context, subaccountGUID string) saops.ApiGetAllServiceManagerBindingsV2Request

func (*SubaccountServiceFake) GetServiceManagementBinding

func (s *SubaccountServiceFake) GetServiceManagementBinding(ctx context.Context, subaccountGUID string) saops.ApiGetServiceManagementBindingRequest

func (*SubaccountServiceFake) GetServiceManagerBindingV2

func (s *SubaccountServiceFake) GetServiceManagerBindingV2(ctx context.Context, subaccountGUID string, bindingName string) saops.ApiGetServiceManagerBindingV2Request

func (*SubaccountServiceFake) GetSubaccount

func (s *SubaccountServiceFake) GetSubaccount(ctx context.Context, subaccountGUID string) saops.ApiGetSubaccountRequest

func (*SubaccountServiceFake) GetSubaccountCustomProperties

func (s *SubaccountServiceFake) GetSubaccountCustomProperties(ctx context.Context, subaccountGUID string) saops.ApiGetSubaccountCustomPropertiesRequest

func (*SubaccountServiceFake) GetSubaccountCustomPropertiesExecute

func (*SubaccountServiceFake) GetSubaccountExecute

func (*SubaccountServiceFake) GetSubaccountLabels

func (s *SubaccountServiceFake) GetSubaccountLabels(ctx context.Context, subaccountGUID string) saops.ApiGetSubaccountLabelsRequest

func (*SubaccountServiceFake) GetSubaccountLabelsExecute

func (*SubaccountServiceFake) GetSubaccountSettings

func (s *SubaccountServiceFake) GetSubaccountSettings(ctx context.Context, subaccountGUID string) saops.ApiGetSubaccountSettingsRequest

func (*SubaccountServiceFake) GetSubaccountSettingsExecute

func (*SubaccountServiceFake) GetSubaccounts

func (*SubaccountServiceFake) GetSubaccountsExecute

func (*SubaccountServiceFake) MoveSubaccount

func (s *SubaccountServiceFake) MoveSubaccount(ctx context.Context, subaccountGUID string) saops.ApiMoveSubaccountRequest

func (*SubaccountServiceFake) MoveSubaccountExecute

func (*SubaccountServiceFake) MoveSubaccounts

func (*SubaccountServiceFake) MoveSubaccountsExecute

func (*SubaccountServiceFake) UpdateSubaccount

func (s *SubaccountServiceFake) UpdateSubaccount(ctx context.Context, subaccountGUID string) saops.ApiUpdateSubaccountRequest

func (*SubaccountServiceFake) UpdateSubaccountExecute

type TfClient

type TfClient struct {
	// contains filtered or unexported fields
}

func (*TfClient) CreateResources

func (tf *TfClient) CreateResources(ctx context.Context, cr *apisv1beta1.ServiceManager) (string, string, error)

CreateResources creates the service manager instance and binding What of the resources need to be created is determined by set IDs in SM's status

func (*TfClient) DeleteResources

func (tf *TfClient) DeleteResources(ctx context.Context, cr *apisv1beta1.ServiceManager) error

func (*TfClient) ObserveResources

func (tf *TfClient) ObserveResources(ctx context.Context, cr *apisv1beta1.ServiceManager) (ResourcesStatus, error)

func (*TfClient) UpdateResources

func (tf *TfClient) UpdateResources(ctx context.Context, cr *apisv1beta1.ServiceManager) error

type TfClientInitializer

type TfClientInitializer struct {
	// contains filtered or unexported fields
}

func NewServiceManagerTfClient

func NewServiceManagerTfClient(sConnector managed.ExternalConnecter, sbConnector managed.ExternalConnecter, defaults Defaults) *TfClientInitializer

func (*TfClientInitializer) ConnectResources

func (tfI *TfClientInitializer) ConnectResources(ctx context.Context, cr *apisv1beta1.ServiceManager) (ITfClient, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL