Documentation
¶
Index ¶
- Constants
- func GetAppNamesBySubaccountAndApp(subaccountId string, appName string, client *ClientFacade) (technicalAppName string, commercialAppName string, err error)
- func GetDefaultRoleCollectionsByDirectory(directoryId string, client *ClientFacade) (defaultRoleCollectionNames []string, err error)
- func GetDefaultRoleCollectionsBySubaccount(subaccountId string, client *ClientFacade) (defaultRoleCollectionNames []string, err error)
- func GetDefaultRolesByDirectory(directoryId string, client *ClientFacade) (defaultRoles []string, err error)
- func GetDefaultRolesBySubaccount(subaccountId string, client *ClientFacade) (defaults []string, err error)
- func GetGlobalAccountId(client *ClientFacade) (string, error)
- func GetServiceDataByPlanId(client *ClientFacade, subaccountId string, planId string) (planName string, serviceName string, err error)
- func NewV2Client(serverURL *url.URL) *v2Client
- func NewV2ClientWithHttpClient(client *http.Client, serverURL *url.URL) *v2Client
- type Action
- type BtpClientError
- type ClientFacade
- func (v2 ClientFacade) Execute(ctx context.Context, cmdReq *CommandRequest, options ...CommandOptions) (cmdRes CommandResponse, err error)
- func (v2 ClientFacade) GetGlobalAccountSubdomain() string
- func (v2 ClientFacade) GetLoggedInUser() *v2LoggedInUser
- func (v2 ClientFacade) IdTokenLogin(ctx context.Context, loginReq *IdTokenLoginRequest) (*LoginResponse, error)
- func (v2 ClientFacade) Login(ctx context.Context, loginReq *LoginRequest) (*LoginResponse, error)
- func (v2 ClientFacade) PasscodeLogin(ctx context.Context, loginReq *PasscodeLoginRequest) (*LoginResponse, error)
- type CommandOptions
- type CommandRequest
- type CommandResponse
- type IdTokenLoginRequest
- type LoginRequest
- type LoginResponse
- type PasscodeLoginRequest
- type Session
- type SmBrokerError
Constants ¶
View Source
const ( HeaderCorrelationID string = "X-Correlationid" HeaderIDToken string = "X-Id-Token" HeaderCLIFormat string = "X-Cpcli-Format" HeaderCLISessionId string = "X-Cpcli-Sessionid" HeaderCLISubdomain string = "X-Cpcli-Subdomain" HeaderCLICustomIDP string = "X-Cpcli-Customidp" HeaderCLIBackendStatus string = "X-Cpcli-Backend-Status" HeaderCLIBackendMessage string = "X-Cpcli-Backend-Message" HeaderCLIBackendMediaType string = "X-Cpcli-Backend-Mediatype" HeaderCLIClientUpdate string = "X-Cpcli-Client-Update" HeaderCLIServerMessage string = "X-Cpcli-Server-Message" )
View Source
const DefaultServerURL string = "https://cli.btp.cloud.sap"
Variables ¶
This section is empty.
Functions ¶
func GetAppNamesBySubaccountAndApp ¶ added in v1.1.0
func GetDefaultRoleCollectionsByDirectory ¶
func GetDefaultRoleCollectionsByDirectory(directoryId string, client *ClientFacade) (defaultRoleCollectionNames []string, err error)
func GetDefaultRoleCollectionsBySubaccount ¶
func GetDefaultRoleCollectionsBySubaccount(subaccountId string, client *ClientFacade) (defaultRoleCollectionNames []string, err error)
func GetDefaultRolesByDirectory ¶
func GetDefaultRolesByDirectory(directoryId string, client *ClientFacade) (defaultRoles []string, err error)
func GetDefaultRolesBySubaccount ¶
func GetDefaultRolesBySubaccount(subaccountId string, client *ClientFacade) (defaults []string, err error)
func GetGlobalAccountId ¶
func GetGlobalAccountId(client *ClientFacade) (string, error)
func GetServiceDataByPlanId ¶
func NewV2Client ¶
Types ¶
type BtpClientError ¶
type BtpClientError struct { Message string `json:"error"` // This should always be available Description string `json:"description"` BrokerError *SmBrokerError `json:"broker_error"` // Service Broker/Service Manager specific }
We define an Uber Error type that is used to handle errors from the BTP CLI client. The error structure comprises the possible JSON structure of the error responses
type ClientFacade ¶
type ClientFacade struct { Accounts accountsFacade Services servicesFacade Offering servicesOfferingFacade Security securityFacade // contains filtered or unexported fields }
func GetLoggedInClient ¶
func GetLoggedInClient() (*ClientFacade, error)
func NewClientFacade ¶
func NewClientFacade(cliClient *v2Client) *ClientFacade
func (ClientFacade) Execute ¶
func (v2 ClientFacade) Execute(ctx context.Context, cmdReq *CommandRequest, options ...CommandOptions) (cmdRes CommandResponse, err error)
Execute executes a command
func (ClientFacade) GetGlobalAccountSubdomain ¶
func (v2 ClientFacade) GetGlobalAccountSubdomain() string
func (ClientFacade) GetLoggedInUser ¶
func (v2 ClientFacade) GetLoggedInUser() *v2LoggedInUser
func (ClientFacade) IdTokenLogin ¶
func (v2 ClientFacade) IdTokenLogin(ctx context.Context, loginReq *IdTokenLoginRequest) (*LoginResponse, error)
IdTokenLogin authenticates a user by providing an id token
func (ClientFacade) Login ¶
func (v2 ClientFacade) Login(ctx context.Context, loginReq *LoginRequest) (*LoginResponse, error)
Login authenticates a user using username + password
func (ClientFacade) PasscodeLogin ¶
func (v2 ClientFacade) PasscodeLogin(ctx context.Context, loginReq *PasscodeLoginRequest) (*LoginResponse, error)
PasscodeLogin authenticates with a pem encoded x509 key-pair
type CommandOptions ¶
type CommandRequest ¶
func NewCommandRequest ¶
func NewCommandRequest(action Action, command string, args any) *CommandRequest
Command
func NewGetRequest ¶
func NewGetRequest(command string, args any) *CommandRequest
func NewListRequest ¶
func NewListRequest(command string, args any) *CommandRequest
type CommandResponse ¶
type CommandResponse struct { StatusCode int ContentType string Body io.ReadCloser }
type IdTokenLoginRequest ¶
type IdTokenLoginRequest struct { GlobalAccountSubdomain string `json:"subdomain"` IdToken string `json:"idToken"` }
func NewIdTokenLoginRequest ¶
func NewIdTokenLoginRequest(globalaccountSubdomain string, idToken string) *IdTokenLoginRequest
type LoginRequest ¶
type LoginRequest struct { IdentityProvider string `json:"customIdp"` GlobalAccountSubdomain string `json:"subdomain"` Username string `json:"userName"` Password string `json:"password"` }
func NewLoginRequest ¶
func NewLoginRequest(globalaccountSubdomain string, username string, password string) *LoginRequest
NewLoginRequest returns a new LoginRequest with `ldap` as default IdentityProvider set.
func NewLoginRequestWithCustomIDP ¶
func NewLoginRequestWithCustomIDP(idp string, globalaccountSubdomain string, username string, password string) *LoginRequest
type LoginResponse ¶
type PasscodeLoginRequest ¶
type SmBrokerError ¶
type SmBrokerError struct { // The broker status code. StatusCode int32 `json:"StatusCode"` // A machine-readable error string that may be returned by the broker. ErrorMessage string `json:"ErrorMessage"` // A human-readable description of the error that may be returned by the broker. Description string `json:"Description"` // ResponseError is set to the error that occurred when unmarshalling a response body from the broker. ResponseError string `json:"ResponseError"` }
The service broker error
Source Files
¶
- actions.go
- client.go
- clienttypes.go
- facade.go
- facade_accounts.go
- facade_accounts_global_account.go
- facade_accounts_subscription.go
- facade_security.go
- facade_security_role.go
- facade_security_role_collection.go
- facade_services.go
- facade_services_offering.go
- facade_services_plan.go
- helper.go
- session.go
- transport.go
- wrapper.go
Directories
¶
Path | Synopsis |
---|---|
types
|
|
cis
* Accounts Service * * The Accounts service provides REST APIs that are responsible for the management of global accounts, and the creation and management of directories, subaccounts, and their custom properties/tags.
|
* Accounts Service * * The Accounts service provides REST APIs that are responsible for the management of global accounts, and the creation and management of directories, subaccounts, and their custom properties/tags. |
saas_manager_service
* SaaS Provisioning Service * * The SAP SaaS Provisioning service provides REST APIs that are responsible for the registration and provisioning of multitenant applications and services.
|
* SaaS Provisioning Service * * The SAP SaaS Provisioning service provides REST APIs that are responsible for the registration and provisioning of multitenant applications and services. |
servicemanager
* Service Manager * * Service Manager provides REST APIs that are responsible for the creation and consumption of service instances in any connected runtime environment.
|
* Service Manager * * Service Manager provides REST APIs that are responsible for the creation and consumption of service instances in any connected runtime environment. |
xsuaa_authz
* Authorization * * Provides functions to administrate the Authorization and Trust Management service (XSUAA) of SAP BTP, Cloud Foundry environment.
|
* Authorization * * Provides functions to administrate the Authorization and Trust Management service (XSUAA) of SAP BTP, Cloud Foundry environment. |
Click to show internal directories.
Click to hide internal directories.