btp

package
v1.488.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetJSON

func GetJSON(value string) (string, error)

func IsServiceBindingCreated

func IsServiceBindingCreated(btp *BTPUtils, options GetServiceBindingOptions) bool

func IsServiceBindingDeleted

func IsServiceBindingDeleted(btp *BTPUtils, options GetServiceBindingOptions) bool

func IsServiceInstanceCreated

func IsServiceInstanceCreated(btp *BTPUtils, options GetServiceInstanceOptions) bool

func IsServiceInstanceDeleted

func IsServiceInstanceDeleted(btp *BTPUtils, options GetServiceInstanceOptions) bool

Types

type BTPCommandBuilder

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

func NewBTPCommandBuilder

func NewBTPCommandBuilder() *BTPCommandBuilder

Initialize a new builder

func (*BTPCommandBuilder) Build

func (b *BTPCommandBuilder) Build() ([]string, error)

Build the final command string

func (*BTPCommandBuilder) Reset

Rest builder

func (*BTPCommandBuilder) SetConfirm

func (b *BTPCommandBuilder) SetConfirm(value bool) *BTPCommandBuilder

Specific method for --confirm parameter

func (*BTPCommandBuilder) SetShowParameters

func (b *BTPCommandBuilder) SetShowParameters(value bool) *BTPCommandBuilder

Specific method for --show-parameters parameter

func (*BTPCommandBuilder) WithAction

func (b *BTPCommandBuilder) WithAction(action string) *BTPCommandBuilder

Method to set action

func (*BTPCommandBuilder) WithBindingName

func (b *BTPCommandBuilder) WithBindingName(name string) *BTPCommandBuilder

Specific method for --binding parameter

func (*BTPCommandBuilder) WithConfirm

func (b *BTPCommandBuilder) WithConfirm() *BTPCommandBuilder

func (*BTPCommandBuilder) WithDataCenter

func (b *BTPCommandBuilder) WithDataCenter(name string) *BTPCommandBuilder

Specific method for --data-center parameter

func (*BTPCommandBuilder) WithFieldsFilter

func (b *BTPCommandBuilder) WithFieldsFilter(query string) *BTPCommandBuilder

Specific method for --fields-filter parameter

func (*BTPCommandBuilder) WithFormat

func (b *BTPCommandBuilder) WithFormat(format string) *BTPCommandBuilder

Method to set format of response

func (*BTPCommandBuilder) WithID

Specific method for --id parameter

func (*BTPCommandBuilder) WithLabels

func (b *BTPCommandBuilder) WithLabels(json string) *BTPCommandBuilder

Specific method for --labels parameter

func (*BTPCommandBuilder) WithLabelsFilter

func (b *BTPCommandBuilder) WithLabelsFilter(query string) *BTPCommandBuilder

Specific method for --labels-filter parameter

func (*BTPCommandBuilder) WithName

func (b *BTPCommandBuilder) WithName(name string) *BTPCommandBuilder

Specific method for --name parameter

func (*BTPCommandBuilder) WithOfferingName

func (b *BTPCommandBuilder) WithOfferingName(name string) *BTPCommandBuilder

Specific method for --offering-name parameter

func (*BTPCommandBuilder) WithOption

func (b *BTPCommandBuilder) WithOption(option string) *BTPCommandBuilder

General method to add an option

func (*BTPCommandBuilder) WithParam

func (b *BTPCommandBuilder) WithParam(param string) *BTPCommandBuilder

Method to add additional parameters

func (*BTPCommandBuilder) WithParameters

func (b *BTPCommandBuilder) WithParameters(json string) *BTPCommandBuilder

Specific method for --offering-name parameter

func (*BTPCommandBuilder) WithPassword

func (b *BTPCommandBuilder) WithPassword(password string) *BTPCommandBuilder

Specific method for --password parameter

func (*BTPCommandBuilder) WithPlanID

func (b *BTPCommandBuilder) WithPlanID(id string) *BTPCommandBuilder

Specific method for --plan parameter

func (*BTPCommandBuilder) WithPlanName

func (b *BTPCommandBuilder) WithPlanName(name string) *BTPCommandBuilder

Specific method for --plan-name parameter

func (*BTPCommandBuilder) WithService

func (b *BTPCommandBuilder) WithService(name string) *BTPCommandBuilder

Specific method for --service parameter

func (*BTPCommandBuilder) WithServiceInstanceID

func (b *BTPCommandBuilder) WithServiceInstanceID(id string) *BTPCommandBuilder

Specific method for --instance-name parameter

func (*BTPCommandBuilder) WithServiceInstanceName

func (b *BTPCommandBuilder) WithServiceInstanceName(name string) *BTPCommandBuilder

Specific method for --instance-name parameter

func (*BTPCommandBuilder) WithSubAccount

func (b *BTPCommandBuilder) WithSubAccount(subaccount string) *BTPCommandBuilder

Specific method for --subaccount parameter

func (*BTPCommandBuilder) WithSubdomain

func (b *BTPCommandBuilder) WithSubdomain(globalAccount string) *BTPCommandBuilder

Specific method for --subdomain parameter

func (*BTPCommandBuilder) WithTarget

func (b *BTPCommandBuilder) WithTarget(target string) *BTPCommandBuilder

Method to set target (e.g., GROUP/OBJECT)

func (*BTPCommandBuilder) WithTenant

func (b *BTPCommandBuilder) WithTenant(tenantID string) *BTPCommandBuilder

Specific method for --idp parameter

func (*BTPCommandBuilder) WithURL

func (b *BTPCommandBuilder) WithURL(url string) *BTPCommandBuilder

Specific method for --url parameter

func (*BTPCommandBuilder) WithUser

func (b *BTPCommandBuilder) WithUser(user string) *BTPCommandBuilder

Specific method for --user parameter

func (*BTPCommandBuilder) WithVerbose

func (b *BTPCommandBuilder) WithVerbose() *BTPCommandBuilder

Method to activate verbose mode

type BTPUtils

type BTPUtils struct {
	Exec ExecRunner
}

func NewBTPUtils

func NewBTPUtils(exec ExecRunner) *BTPUtils

func (*BTPUtils) CreateServiceBinding

func (btp *BTPUtils) CreateServiceBinding(options CreateServiceBindingOptions) (string, error)

func (*BTPUtils) CreateServiceInstance

func (btp *BTPUtils) CreateServiceInstance(options CreateServiceInstanceOptions) (string, error)

func (*BTPUtils) DeleteServiceBinding

func (btp *BTPUtils) DeleteServiceBinding(options DeleteServiceBindingOptions) error

func (*BTPUtils) DeleteServiceInstance

func (btp *BTPUtils) DeleteServiceInstance(options DeleteServiceInstanceOptions) error

func (*BTPUtils) GetServiceBinding

func (btp *BTPUtils) GetServiceBinding(options GetServiceBindingOptions) (string, error)

func (*BTPUtils) GetServiceInstance

func (btp *BTPUtils) GetServiceInstance(options GetServiceInstanceOptions) (string, error)

func (*BTPUtils) Login

func (btp *BTPUtils) Login(options LoginOptions) error

func (*BTPUtils) Logout

func (btp *BTPUtils) Logout() error

func (*BTPUtils) SetConfig

func (btp *BTPUtils) SetConfig(options ConfigOptions) error

type BtpExecCall

type BtpExecCall struct {
	Exec   string
	Params []string
}

Stores information about executed commands.

type BtpExecutorMock

type BtpExecutorMock struct {
	Cmd                 command.Command
	Calls               []BtpExecCall
	StdoutReturn        map[string]string
	ShouldFailOnCommand map[string]error
	ExitCode            int
	// contains filtered or unexported fields
}

func (*BtpExecutorMock) GetStdoutValue

func (b *BtpExecutorMock) GetStdoutValue() string

func (*BtpExecutorMock) Run

func (b *BtpExecutorMock) Run(cmdScript []string) (err error)

func (*BtpExecutorMock) RunSync

func (b *BtpExecutorMock) RunSync(opts RunSyncOptions) error

func (*BtpExecutorMock) Stdin

func (b *BtpExecutorMock) Stdin(in io.Reader)

func (*BtpExecutorMock) Stdout

func (b *BtpExecutorMock) Stdout(out io.Writer)

type ConfigOptions

type ConfigOptions struct {
	Format  string
	Verbose bool
}

type CreateServiceBindingOptions

type CreateServiceBindingOptions struct {
	Url             string
	Subdomain       string
	Subaccount      string
	ServiceInstance string
	BindingName     string
	Parameters      string
	User            string
	Password        string
	Tenant          string
	Timeout         int
	PollInterval    int
}

type CreateServiceInstanceOptions

type CreateServiceInstanceOptions struct {
	Url          string
	Subdomain    string
	User         string
	Password     string
	Tenant       string
	Subaccount   string
	PlanName     string
	OfferingName string
	InstanceName string
	Parameters   string
	Timeout      int
	PollInterval int
}

type DeleteServiceBindingOptions

type DeleteServiceBindingOptions struct {
	Url          string
	Subdomain    string
	Subaccount   string
	BindingName  string
	User         string
	Password     string
	Tenant       string
	Timeout      int
	PollInterval int
}

type DeleteServiceInstanceOptions

type DeleteServiceInstanceOptions struct {
	Url          string
	Subdomain    string
	User         string
	Password     string
	Tenant       string
	Subaccount   string
	InstanceName string
	Timeout      int
	PollInterval int
}

type ExecRunner

type ExecRunner interface {
	Run(cmdScript []string) error
	RunSync(opts RunSyncOptions) error
	// contains filtered or unexported methods
}

type Executor

type Executor struct {
	Cmd command.Command
}

func (*Executor) GetStdoutValue

func (e *Executor) GetStdoutValue() string

func (*Executor) Run

func (e *Executor) Run(cmdScript []string) (err error)

func (*Executor) RunSync

func (e *Executor) RunSync(opts RunSyncOptions) (err error)

@param timeout : in seconds @param pollInterval : in seconds @param negativeCheck : set to false if you want to check the negation of the response of `cmdCheck`

func (*Executor) Stdin

func (e *Executor) Stdin(stdin io.Reader)

Stdin ..

func (*Executor) Stdout

func (e *Executor) Stdout(stdout io.Writer)

Stdout ..

type GetServiceBindingOptions

type GetServiceBindingOptions struct {
	Url         string
	Subdomain   string
	Subaccount  string
	BindingName string
	User        string
	Password    string
	Tenant      string
}

type GetServiceInstanceOptions

type GetServiceInstanceOptions struct {
	Url          string
	Subdomain    string
	User         string
	Password     string
	Tenant       string
	Subaccount   string
	InstanceName string
}

type LoginOptions

type LoginOptions struct {
	Url       string
	Subdomain string
	User      string
	Password  string
	Tenant    string
}

type RunSyncOptions

type RunSyncOptions struct {
	CmdScript      []string
	TimeoutSeconds int
	PollInterval   int
	CheckFunc      func() bool // Function to check the command status
}

type ServiceBindingData

type ServiceBindingData struct {
	ID            string `json:"id"`
	Ready         bool   `json:"ready"`
	LastOperation struct {
		ID                  string    `json:"id"`
		Ready               bool      `json:"ready"`
		Type                string    `json:"type"`
		State               string    `json:"state"`
		ResourceID          string    `json:"resource_id"`
		ResourceType        string    `json:"resource_type"`
		PlatformID          string    `json:"platform_id"`
		CorrelationID       string    `json:"correlation_id"`
		Reschedule          bool      `json:"reschedule"`
		RescheduleTimestamp time.Time `json:"reschedule_timestamp"`
		DeletionScheduled   time.Time `json:"deletion_scheduled"`
		CreatedAt           time.Time `json:"created_at"`
		UpdatedAt           time.Time `json:"updated_at"`
	} `json:"last_operation"`
	Name              string `json:"name"`
	ServiceInstanceID string `json:"service_instance_id"`
	Context           struct {
		Origin            string `json:"origin"`
		Region            string `json:"region"`
		ZoneID            string `json:"zone_id"`
		EnvType           string `json:"env_type"`
		Platform          string `json:"platform"`
		Subdomain         string `json:"subdomain"`
		LicenseType       string `json:"license_type"`
		InstanceName      string `json:"instance_name"`
		SubaccountID      string `json:"subaccount_id"`
		CrmCustomerID     string `json:"crm_customer_id"`
		GlobalAccountID   string `json:"global_account_id"`
		ServiceInstanceID string `json:"service_instance_id"`
	} `json:"context"`
	Credentials struct {
		Abap struct {
			CommunicationArrangementID       string `json:"communication_arrangement_id"`
			CommunicationInboundUserAuthMode string `json:"communication_inbound_user_auth_mode"`
			CommunicationInboundUserID       string `json:"communication_inbound_user_id"`
			CommunicationScenarioID          string `json:"communication_scenario_id"`
			CommunicationSystemID            string `json:"communication_system_id"`
			CommunicationType                string `json:"communication_type"`
			Password                         string `json:"password"`
			Username                         string `json:"username"`
		} `json:"abap"`
		Binding struct {
			Env     string `json:"env"`
			ID      string `json:"id"`
			Type    string `json:"type"`
			Version string `json:"version"`
		} `json:"binding"`
		PreserveHostHeader bool   `json:"preserve_host_header"`
		SapCloudService    string `json:"sap.cloud.service"`
		Systemid           string `json:"systemid"`
		URL                string `json:"url"`
	} `json:"credentials"`
	SubaccountID string    `json:"subaccount_id"`
	CreatedBy    string    `json:"created_by"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
	Labels       string    `json:"labels"`
}

type ServiceInstanceData

type ServiceInstanceData struct {
	ID            string `json:"id"`
	Ready         bool   `json:"ready"`
	LastOperation struct {
		ID                  string    `json:"id"`
		Ready               bool      `json:"ready"`
		Description         string    `json:"description"`
		Type                string    `json:"type"`
		State               string    `json:"state"`
		ResourceID          string    `json:"resource_id"`
		ResourceType        string    `json:"resource_type"`
		PlatformID          string    `json:"platform_id"`
		CorrelationID       string    `json:"correlation_id"`
		Reschedule          bool      `json:"reschedule"`
		RescheduleTimestamp time.Time `json:"reschedule_timestamp"`
		DeletionScheduled   time.Time `json:"deletion_scheduled"`
		CreatedAt           time.Time `json:"created_at"`
		UpdatedAt           time.Time `json:"updated_at"`
	} `json:"last_operation"`
	Name          string `json:"name"`
	ServicePlanID string `json:"service_plan_id"`
	PlatformID    string `json:"platform_id"`
	DashboardURL  string `json:"dashboard_url"`
	Context       struct {
		Origin          string `json:"origin"`
		Region          string `json:"region"`
		ZoneID          string `json:"zone_id"`
		EnvType         string `json:"env_type"`
		Platform        string `json:"platform"`
		Subdomain       string `json:"subdomain"`
		LicenseType     string `json:"license_type"`
		InstanceName    string `json:"instance_name"`
		SubaccountID    string `json:"subaccount_id"`
		CrmCustomerID   string `json:"crm_customer_id"`
		GlobalAccountID string `json:"global_account_id"`
	} `json:"context"`
	Usable       bool        `json:"usable"`
	SubaccountID string      `json:"subaccount_id"`
	Protected    interface{} `json:"protected"`
	CreatedBy    string      `json:"created_by"`
	CreatedAt    time.Time   `json:"created_at"`
	UpdatedAt    time.Time   `json:"updated_at"`
	Labels       string      `json:"labels"`
}

Jump to

Keyboard shortcuts

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