cmd

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 46 Imported by: 0

Documentation

Overview

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Code generated from specification version 1.0.0: DO NOT EDIT

Index

Constants

View Source
const (
	FlagDataName                  = "data"
	FlagDataTemplateName          = "template"
	FlagDataTemplateVariablesName = "templateVars"
	FlagProcessingModeName        = "processingMode"
)
View Source
const (
	// SettingsIncludeAllPageSize property name used to control the default page size when using includeAll parameter
	SettingsIncludeAllPageSize string = "settings.includeAll.pageSize"

	// SettingsIncludeAllDelayMS property name used to control the delay between fetching the next page
	SettingsIncludeAllDelayMS string = "settings.includeAll.delayMS"

	// SettingsDefaultPageSize property name used to control the default page size
	SettingsDefaultPageSize string = "settings.default.pageSize"

	// SettingsConfigPath configuration path
	SettingsConfigPath string = "settings.path"

	// SettingsTemplatePath template path where the template files are located
	SettingsTemplatePath string = "settings.template.path"

	// SettingsModeEnableCreate enables create (post) commands
	SettingsModeEnableCreate string = "settings.mode.enableCreate"

	// SettingsModeEnableUpdate enables update commands
	SettingsModeEnableUpdate string = "settings.mode.enableUpdate"

	// SettingsModeEnableDelete enables delete commands
	SettingsModeEnableDelete string = "settings.mode.enableDelete"

	// SettingsEncryptionEnabled enables encryption when storing sensitive session data
	SettingsEncryptionEnabled string = "settings.encryption.enabled"

	// SettingsModeCI enable continuous integration mode (this will enable all commands)
	SettingsModeCI string = "settings.ci"
)
View Source
const CumulocityDefaultPageSize int = 5

CumulocityDefaultPageSize is the default page size used by Cumulocity

View Source
const SettingsGlobalName = "settings"

SettingsGlobalName name of the settings file (without extension)

Variables

View Source
var CumulocityProperties = map[string]bool{
	"additionParents": true,
	"assetParents":    true,
	"childAdditions":  true,
	"childAssets":     true,
	"childDevices":    true,
	"deviceParents":   true,
	"creationTime":    true,
	"lastUpdated":     true,
	"self":            true,
}

CumulocityProperties contain a map of the static properties which are generally read-only and only controlled internally by Cumulocity or by other API calls

View Source
var Logger *logger.Logger

Logger is used to record the log messages which should be visible to the user when using the verbose flag

View Source
var SecureDataAccessor *encrypt.SecureData

SecureDataAccessor reads and writes encrypted data

Functions

func Execute

func Execute()

Execute runs the root command and initializes the configuration manager and c8y client

func FilterJSON

func FilterJSON(value gjson.Result, paths []string) (data []string)

func GetFileContentType

func GetFileContentType(out *os.File) (string, error)

GetFileContentType TODO: Fix mime detection because it currently returns only application/octet-stream

func GetIDArray

func GetIDArray(values []string) (ids []string)

func GetIDs

func GetIDs(cmd *cobra.Command, args []string) (ids []string)

GetIDs returns a list of IDs --id 1234,1234 (comma seperated list (without spaces!)) --id "22437097744 1235" [22437097744, 1235] --id 22437097744 1235,1234 (requires positional arguments as well) --id 22437097744 1235,1234 asdfasdf asdfasdf will be ignored as it does not match the pattern

func GetManifestFile

func GetManifestFile(zipFilename string) (string, error)

GetManifestFile extracts the Cumulocity microservice manifest file from a given zip file

func MustParseJSON

func MustParseJSON(value string) map[string]interface{}

MustParseJSON parses a string and returns the map structure

func ParseJSON added in v1.6.0

func ParseJSON(value string, data map[string]interface{}) error

ParseJSON parses a string and returns the map structure. It will parse json and shorthand json.

func ParseValues

func ParseValues(values []string) (ids []string)

func ReadConfigFiles added in v1.5.0

func ReadConfigFiles(v *viper.Viper) (path string, err error)

ReadConfigFiles reads multiple configuration files to load the c8y session and other settings

The session files are 1. load settings (from C8Y_SESSION_HOME path) 2. load session file (by path) 3. load session file (by name)

func RemoveCumulocityProperties added in v1.6.0

func RemoveCumulocityProperties(data map[string]interface{}, removeID bool) map[string]interface{}

RemoveCumulocityProperties removes cumulocity properties from a map so it can be re-used in further Cumulocity requests, or the data view can be simplified

func RemoveEmptyStrings

func RemoveEmptyStrings(array []string) []string

RemoveEmptyStrings returns a new array where the strings are not empty (after trimming space)

func SplitString

func SplitString(value string, sep string) []string

func WriteAuth added in v1.7.0

func WriteAuth(v *viper.Viper) error

Types

type Authentication added in v1.7.0

type Authentication struct {
	AuthType string         `json:"authType,omitempty"`
	Cookies  []*http.Cookie `json:"cookies,omitempty"`
}

type CommonCommandOptions added in v1.4.0

type CommonCommandOptions struct {
	OutputFile     string
	Filters        *JSONFilters
	ResultProperty string
	IncludeAll     bool
	WithTotalPages bool
	PageSize       int
	CurrentPage    int64
	TotalPages     int64
}

CommonCommandOptions control the handling of the response which are available for all commands which interact with the server

func (CommonCommandOptions) AddQueryParameters added in v1.5.0

func (options CommonCommandOptions) AddQueryParameters(query *url.Values)

AddQueryParameters adds the common query parameters to the given query values

type CumulocitySession

type CumulocitySession struct {
	// ID          string `json:"id"`
	Host            string `json:"host"`
	Tenant          string `json:"tenant"`
	Username        string `json:"username"`
	Password        string `json:"password"`
	Description     string `json:"description"`
	UseTenantPrefix bool   `json:"useTenantPrefix"`

	MicroserviceAliases map[string]string `json:"microserviceAliases,omitempty"`

	Index int    `json:"-"`
	Path  string `json:"-"`
	Name  string `json:"-"`
}

CumulocitySession contains all settings required to communicate with a Cumulocity service

func NewCumulocitySessionFromFile

func NewCumulocitySessionFromFile(filePath string) (*CumulocitySession, error)

func (CumulocitySession) GetHost

func (s CumulocitySession) GetHost() string

func (CumulocitySession) GetPassword

func (s CumulocitySession) GetPassword() string

func (CumulocitySession) GetSessionPassphrase added in v1.7.0

func (s CumulocitySession) GetSessionPassphrase() string

func (*CumulocitySession) SetHost

func (s *CumulocitySession) SetHost(host string)

func (*CumulocitySession) SetPassword

func (s *CumulocitySession) SetPassword(password string)

type CumulocitySessionDetails added in v1.8.0

type CumulocitySessionDetails struct {
	CumulocitySession

	Path string `json:"path"`
	Name string `json:"name"`
}

CumulocitySessionDetails public details about the current session

type CumulocitySessions

type CumulocitySessions struct {
	Sessions []CumulocitySession `json:"sessions"`
}

type JSONFilter

type JSONFilter struct {
	Property  string
	Operation string
	Value     string
}

type JSONFilters

type JSONFilters struct {
	Filters   []JSONFilter
	Selectors []string
	Pluck     string
}

func (*JSONFilters) Add

func (f *JSONFilters) Add(property, operation, value string)

func (*JSONFilters) AddSelectors

func (f *JSONFilters) AddSelectors(props ...string)

func (JSONFilters) Apply

func (f JSONFilters) Apply(jsonValue string, property string) []byte

Source Files

Jump to

Keyboard shortcuts

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