clientManager

package
v0.0.0-...-c85cc39 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

Package clientManager provides a CLI to end-users

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

################################################################################ # Copyright 2019 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientSetup

func GetClientSetup(outputFormat string) (string, error)

GetAPISetup retrieves the API Setup

func NewToken

func NewToken() string

NewToken creates Token base on time

func NewTokenFile

func NewTokenFile(filePath string) error

NewTokenFile creates a file containing a token

func RemoveAPISetup

func RemoveAPISetup() error

RemoveAPISetup removes the file where the API Setup is stored

func SetClientSetup

func SetClientSetup(urlIn string, outputFormat string, timeout string, caCertPath string, insecureSSL string, token string, defaultExtensionName string) error

SetAPISetup set the API configuration

Types

type CommandsRunnerClient

type CommandsRunnerClient struct {
	URL          string `json:"url"`
	OutputFormat string `json:"output_format"`
	Timeout      int    `json:"timeout"`
	CACertPath   string `json:"ca_cert_path"`
	Token        string `json:"token"`
	InsecureSSL  bool

	DefaultExtensionName string `json:"default_extension_name"`
	// contains filtered or unexported fields
}

func NewClient

func NewClient(urlIn string, outputFormat string, timeout string, caCertPath string, insecureSSL string, token string, defaultExtensionName string) (*CommandsRunnerClient, error)

NewClient creates a new client

func (*CommandsRunnerClient) Curl

func (crc *CommandsRunnerClient) Curl(method string, url string, dataPath string) (string, error)

GetBOM returns the BOM

func (*CommandsRunnerClient) DeleteStateStates

func (crc *CommandsRunnerClient) DeleteStateStates(extensionName string, pos int, stateName string) (string, error)

func (*CommandsRunnerClient) GenerateConfig

func (crc *CommandsRunnerClient) GenerateConfig(extensionName string) (string, error)

GenerateConfig generattes bmxconfig file

func (*CommandsRunnerClient) GetCMStatus

func (crc *CommandsRunnerClient) GetCMStatus() (string, error)

GetCMStatus returns the configManager status

func (*CommandsRunnerClient) GetCRAbout

func (crc *CommandsRunnerClient) GetCRAbout() (string, error)

GetAbout of CR

func (*CommandsRunnerClient) GetCRLogLevel

func (crc *CommandsRunnerClient) GetCRLogLevel() (string, error)

GetLogLevel of PCM

func (*CommandsRunnerClient) GetCRLogMaxBackups

func (crc *CommandsRunnerClient) GetCRLogMaxBackups() (string, error)

GetCRLogMaxBackups of CR

func (*CommandsRunnerClient) GetCRSettings

func (crc *CommandsRunnerClient) GetCRSettings() (string, error)

GetCRSettings of CR

func (*CommandsRunnerClient) GetConfig

func (crc *CommandsRunnerClient) GetConfig(extensionName string) (string, error)

GetConfig returns the config

func (*CommandsRunnerClient) GetExtensions

func (crc *CommandsRunnerClient) GetExtensions(extensionToList string, catalog bool) (string, error)

func (*CommandsRunnerClient) GetLogs

func (crc *CommandsRunnerClient) GetLogs(extensionName string, stateName string, follow bool, quiet bool) error

GetLogs returns the logs of a given state, if state not provided will retrieve logs from the first state. if follow = true the method will loop for new data in the log if quiet = true then log are not displayed but the method will wait until the deploy is done.

func (*CommandsRunnerClient) GetMockEngine

func (crc *CommandsRunnerClient) GetMockEngine() (string, error)

func (*CommandsRunnerClient) GetProperty

func (crc *CommandsRunnerClient) GetProperty(extensionName string, propertyName string) (string, error)

func (*CommandsRunnerClient) GetState

func (crc *CommandsRunnerClient) GetState(extensionName string, stateName string) (string, error)

GetState returns the status of a given state

func (*CommandsRunnerClient) GetStates

func (crc *CommandsRunnerClient) GetStates(extensionName string, status string, extensionOnly bool, recursive bool) (string, error)

GetStates returns the states having a specific status

func (*CommandsRunnerClient) GetTemplate

func (crc *CommandsRunnerClient) GetTemplate(extensionName string, uiConfigName string) (string, error)

GetUIConfig reeturns the uiconfig

func (*CommandsRunnerClient) GetUIMetadata

func (crc *CommandsRunnerClient) GetUIMetadata(extensionName string, uiConfigName string) (string, error)

GetUIConfig reeturns the uiconfig

func (*CommandsRunnerClient) GetUIMetadatas

func (crc *CommandsRunnerClient) GetUIMetadatas(extensionName string, namesOnly bool) (string, error)

func (*CommandsRunnerClient) InsertStateStates

func (crc *CommandsRunnerClient) InsertStateStates(extensionName string, pos int, stateName string, before bool, statePath string, insertExtensionName string, overwrite bool) (string, error)

func (*CommandsRunnerClient) IsRunningEngine

func (crc *CommandsRunnerClient) IsRunningEngine(extensionName string) (string, error)

IsRunningEngine checks if engine is running". No running state must exit

func (*CommandsRunnerClient) RegisterExtension

func (crc *CommandsRunnerClient) RegisterExtension(pathToZip, extensionName string, force bool) (string, error)

func (*CommandsRunnerClient) ResetEngine

func (crc *CommandsRunnerClient) ResetEngine(extensionName string) (string, error)

ResetEngine resets states, all not "SKIP" states will be set to "READY". No running state must exit

func (*CommandsRunnerClient) RestCall

func (crc *CommandsRunnerClient) RestCall(method string, baseUrl string, uri string, bodyReader io.Reader, headers map[string]string) (string, int, error)

Do a restcall to a given uri

func (*CommandsRunnerClient) SetCMStatus

func (crc *CommandsRunnerClient) SetCMStatus(name string, status string) (string, error)

SetCMStatus set a status

func (*CommandsRunnerClient) SetCRLogLevel

func (crc *CommandsRunnerClient) SetCRLogLevel(level string) (string, error)

func (*CommandsRunnerClient) SetCRLogMaxBackups

func (crc *CommandsRunnerClient) SetCRLogMaxBackups(maxBackups string) (string, error)

func (*CommandsRunnerClient) SetConfig

func (crc *CommandsRunnerClient) SetConfig(extensionName string, configPath string) (string, error)

SetConfig saves config

func (*CommandsRunnerClient) SetMockEngine

func (crc *CommandsRunnerClient) SetMockEngine(mock bool) (string, error)

MockEngine set/unset engine mock mode. No running state must exit

func (*CommandsRunnerClient) SetState

func (crc *CommandsRunnerClient) SetState(extensionName string, stateName string, newStatus string, scriptTimeout string) error

SetState

func (*CommandsRunnerClient) SetStates

func (crc *CommandsRunnerClient) SetStates(extensionName string, statesPath string, overwrite bool) (string, error)

Set a state file

func (*CommandsRunnerClient) SetStatesStatuses

func (crc *CommandsRunnerClient) SetStatesStatuses(extensionName string, newStatus string, fromState string, fromInclude bool, toState string, toInclude bool) (string, error)

Set a state file

func (*CommandsRunnerClient) StartEngine

func (crc *CommandsRunnerClient) StartEngine(extensionName string, fromState string, toState string) (string, error)

StartEngine returns the states

func (*CommandsRunnerClient) UnregisterExtension

func (crc *CommandsRunnerClient) UnregisterExtension(extensionName string) (string, error)

func (*CommandsRunnerClient) ValidateConfig

func (crc *CommandsRunnerClient) ValidateConfig(extensionName string) (string, error)

ValidateConfig saves config

Jump to

Keyboard shortcuts

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