btpcli

package
v0.1.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderCorrelationID              string = "X-CorrelationId"
	HeaderIDToken                    string = "X-Id-Token"
	HeaderCLIFormat                  string = "X-CPCLI-Format"
	HeaderCLIRefreshToken            string = "X-CPCLI-RefreshToken"
	HeaderCLIReplacementRefreshToken string = "X-CPCLI-ReplacementRefreshtoken"
	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"
)
View Source
const DefaultServerURL string = "https://cpcli.cf.eu10.hana.ondemand.com"

Variables

This section is empty.

Functions

func NewV2Client

func NewV2Client(serverURL *url.URL) *v2Client

func NewV2ClientWithHttpClient

func NewV2ClientWithHttpClient(client *http.Client, serverURL *url.URL) *v2Client

Types

type Action

type Action string
const (
	ActionAdd         Action = "add"
	ActionAssign      Action = "assign"
	ActionCreate      Action = "create"
	ActionDelete      Action = "delete"
	ActionDisable     Action = "disable"
	ActionEnable      Action = "enable"
	ActionGet         Action = "get"
	ActionList        Action = "list"
	ActionRegister    Action = "register"
	ActionRemove      Action = "remove"
	ActionShare       Action = "share"
	ActionSubscribe   Action = "subscribe"
	ActionUnassign    Action = "unassign"
	ActionUnregister  Action = "unregister"
	ActionUnshare     Action = "unshare"
	ActionUnsubscribe Action = "unsubscribe"
	ActionUpdate      Action = "update"
)

type ClientFacade

type ClientFacade struct {
	Accounts accountsFacade
	Services servicesFacade
	Security securityFacade
	// contains filtered or unexported fields
}

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) Login

func (v2 ClientFacade) Login(ctx context.Context, loginReq *LoginRequest) (*LoginResponse, error)

Login authenticates a user using username + password

func (ClientFacade) Logout

func (v2 ClientFacade) Logout(ctx context.Context, logoutReq *LogoutRequest) (*LogoutResponse, error)

Logout invalidates the current user session

type CommandOptions

type CommandOptions struct {
	GoodState        int
	KnownErrorStates map[int]string
}

type CommandRequest

type CommandRequest struct {
	Action  Action
	Command string
	Args    any
}

func NewAddRequest

func NewAddRequest(command string, args any) *CommandRequest

NewAddRequest creates a new add request

func NewAssignRequest

func NewAssignRequest(command string, args any) *CommandRequest

NewAssignRequest creates a new assign request

func NewCommandRequest

func NewCommandRequest(action Action, command string, args any) *CommandRequest

Command

func NewCreateRequest

func NewCreateRequest(command string, args any) *CommandRequest

NewCreateRequest creates a new create request

func NewDeleteRequest

func NewDeleteRequest(command string, args any) *CommandRequest

NewDeleteRequest creates a new delete request

func NewDisableRequest

func NewDisableRequest(command string, args any) *CommandRequest

NewDisableRequest creates a new disable request

func NewEnableRequest

func NewEnableRequest(command string, args any) *CommandRequest

NewEnableRequest creates a new enable request

func NewGetRequest

func NewGetRequest(command string, args any) *CommandRequest

NewGetRequest creates a new get request

func NewListRequest

func NewListRequest(command string, args any) *CommandRequest

NewListRequest creates a new list request

func NewRegisterRequest

func NewRegisterRequest(command string, args any) *CommandRequest

NewRegisterRequest creates a new register request

func NewRemoveRequest

func NewRemoveRequest(command string, args any) *CommandRequest

NewRemoveRequest creates a new remove request

func NewShareRequest

func NewShareRequest(command string, args any) *CommandRequest

NewShareRequest creates a new share request

func NewSubscribeRequest

func NewSubscribeRequest(command string, args any) *CommandRequest

NewSubscribeRequest creates a new subscribe request

func NewUnassignRequest

func NewUnassignRequest(command string, args any) *CommandRequest

NewUnassignRequest creates a new unassign request

func NewUnregisterRequest

func NewUnregisterRequest(command string, args any) *CommandRequest

NewUnregisterRequest creates a new unregister request

func NewUnshareRequest

func NewUnshareRequest(command string, args any) *CommandRequest

NewUnshareRequest creates a new unshare request

func NewUnsubscribeRequest

func NewUnsubscribeRequest(command string, args any) *CommandRequest

NewUnsubscribeRequest creates a new unsubscribe request

func NewUpdateRequest

func NewUpdateRequest(command string, args any) *CommandRequest

NewUpdateRequest creates a new update request

type CommandResponse

type CommandResponse struct {
	StatusCode  int
	ContentType string
	Body        io.ReadCloser
}

type DirectoryCreateInput

type DirectoryCreateInput struct {
	DisplayName string              `btpcli:"displayName"`
	Description *string             `btpcli:"description"`
	ParentID    *string             `btpcli:"parentID"`
	Subdomain   *string             `btpcli:"subdomain"`
	Labels      map[string][]string `btpcli:"labels"`
}

type DirectoryRoleCreateInput

type DirectoryRoleCreateInput struct {
	RoleName         string `btpcli:"roleName"`
	AppId            string `btpcli:"appId"`
	RoleTemplateName string `btpcli:"roleTemplateName"`
	DirectoryId      string `btpcli:"directory"`
}

type GlobalAccountRoleCreateInput

type GlobalAccountRoleCreateInput struct {
	RoleName         string `btpcli:"roleName"`
	AppId            string `btpcli:"appId"`
	RoleTemplateName string `btpcli:"roleTemplateName"`
}

type GlobalaccountResourceProviderCreateInput

type GlobalaccountResourceProviderCreateInput struct {
	Provider          string `btpcli:"provider"`
	TechnicalName     string `btpcli:"technicalName"`
	DisplayName       string `btpcli:"displayName"`
	Description       string `btpcli:"description"`
	ConfigurationInfo string `btpcli:"configurationInfo"`
}

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 LoginResponse struct {
	RefreshToken string `json:"refreshToken"`
	Username     string `json:"user"`
	Email        string `json:"mail"`
	Issuer       string `json:"issuer"`
}

type LogoutRequest

type LogoutRequest struct {
	IdentityProvider       string `json:"customIdp"`
	GlobalAccountSubdomain string `json:"subdomain"`
	RefreshToken           string `json:"refreshToken"`
}

func NewLogoutRequest

func NewLogoutRequest(globalaccountSubdomain string) *LogoutRequest

func NewLogoutRequestWithCustomIDP

func NewLogoutRequestWithCustomIDP(idp string, globalaccountSubdomain string) *LogoutRequest

type LogoutResponse

type LogoutResponse struct {
}

type ServiceInstanceCreateInput

type ServiceInstanceCreateInput struct {
	Name          string              `btpcli:"name"`
	Subaccount    string              `btpcli:"subaccount"`
	ServicePlanId string              `btpcli:"plan"`
	Parameters    *string             `btpcli:"parameters"`
	Labels        map[string][]string `btpcli:"labels"`
}

type ServiceInstanceUpdateInput

type ServiceInstanceUpdateInput struct {
	Id            string              `btpcli:"id"`
	NewName       string              `btpcli:"newName"`
	Subaccount    string              `btpcli:"subaccount"`
	ServicePlanId string              `btpcli:"plan"`
	Parameters    *string             `btpcli:"parameters"`
	Labels        map[string][]string `btpcli:"labels"`
}

type Session

type Session struct {
	GlobalAccountSubdomain string
	RefreshToken           string
	IdentityProvider       string
	LoggedInUser           *v2LoggedInUser

	sync.Mutex
}

type SubaccountCreateInput

type SubaccountCreateInput struct {
	BetaEnabled       bool                `btpcli:"betaEnabled"`
	Description       string              `btpcli:"description"`
	Directory         string              `btpcli:"directoryID"`
	DisplayName       string              `btpcli:"displayName"`
	Labels            map[string][]string `btpcli:"labels"`
	Region            string              `btpcli:"region"`
	Subdomain         string              `btpcli:"subdomain"`
	UsedForProduction bool                `btpcli:"usedForProduction"`
}

type SubaccountEnvironmentInstanceCreateInput

type SubaccountEnvironmentInstanceCreateInput struct {
	DisplayName     string `btpcli:"displayName"`
	EnvironmentType string `btpcli:"environmentType"`
	Landscape       string `btpcli:"landscapeLabel"`
	Parameters      string `btpcli:"parameters"`
	Plan            string `btpcli:"plan"`
	Service         string `btpcli:"service"`
	SubaccountID    string `btpcli:"subaccount"`
}

type SubaccountRoleCreateInput

type SubaccountRoleCreateInput struct {
	RoleName         string `btpcli:"roleName"`
	AppId            string `btpcli:"appId"`
	RoleTemplateName string `btpcli:"roleTemplateName"`
	SubaccountId     string `btpcli:"subaccount"`
}

type SubaccountServiceBindingCreateInput

type SubaccountServiceBindingCreateInput struct {
	Subaccount        string  `btpcli:"subaccount"`
	ServiceInstanceId string  `btpcli:"serviceInstanceID"`
	Name              string  `btpcli:"name"`
	Parameters        string  `btpcli:"parameters"`
	Labels            *string `btpcli:"labels"`
}

type TrustConfigurationInput

type TrustConfigurationInput struct {
	IdentityProvider string  `btpcli:"iasTenantUrl"`
	Name             *string `btpcli:"name"`
	Description      *string `btpcli:"description"`
	Origin           *string `btpcli:"origin"`
	Domain           *string `btpcli:"domain"`
}

Directories

Path Synopsis
types
cis
* Entitlements Service * * The Entitlements service provides REST APIs that manage the assignments of entitlements and quotas to subaccounts and directories.
* Entitlements Service * * The Entitlements service provides REST APIs that manage the assignments of entitlements and quotas to subaccounts and directories.
cis_entitlements
* Entitlements Service * * The Entitlements service provides REST APIs that manage the assignments of entitlements and quotas to subaccounts and directories.
* Entitlements Service * * The Entitlements service provides REST APIs that manage the assignments of entitlements and quotas to subaccounts and directories.
provisioning
* Provisioning Service * * The Provisioning service provides REST APIs that are responsible for the provisioning and deprovisioning of environment instances and tenants in the corresponding region.
* Provisioning Service * * The Provisioning service provides REST APIs that are responsible for the provisioning and deprovisioning of environment instances and tenants in the corresponding region.
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.
xsuaa_plattform
* User Management (System for Cross-domain Identity Management (SCIM)) * * Provides functions to administrate the Authorization and Trust Management service (XSUAA) of SAP BTP, Cloud Foundry environment.
* User Management (System for Cross-domain Identity Management (SCIM)) * * Provides functions to administrate the Authorization and Trust Management service (XSUAA) of SAP BTP, Cloud Foundry environment.

Jump to

Keyboard shortcuts

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