c8yfetcher

package
v2.40.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindHostedApplications

func FindHostedApplications(factory *cmdutil.Factory, values []string, lookupID bool, format string, excludeParentTenant bool) ([]entityReference, error)

FindHostedApplications returns hosted applications given either an id or search text @values: An array of ids, or names (with wildcards) @lookupID: Lookup the data if an id is given. If a non-id text is given, the result will always be looked up.

func FindMicroservices

func FindMicroservices(factory *cmdutil.Factory, values []string, lookupID bool, format string, enableOwnerCheck bool) ([]entityReference, error)

findMicroservices returns microservices given either an id or search text @values: An array of ids, or names (with wildcards) @lookupID: Lookup the data if an id is given. If a non-id text is given, the result will always be looked up.

func FindUIPlugins added in v2.40.0

func FindUIPlugins(factory *cmdutil.Factory, values []string, lookupID bool, format string, resolveSharedPlugins bool) ([]entityReference, error)

Find UI Plugins returns plugins given either an id or search text @values: An array of ids, or names (with wildcards) @lookupID: Lookup the data if an id is given. If a non-id text is given, the result will always be looked up.

func GetFetchedResultsAsString

func GetFetchedResultsAsString(refs []entityReference) (results []string, invalidLookups []string)

func IsID

func IsID(v string) bool

func NewIDValue

func NewIDValue(raw string) *idValue

NewIDValue returns a new id formatter Example: NewIDValue("12345|deviceName")

func ParseValues

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

func WithAgentByNameFirstMatch

func WithAgentByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithAgentByNameFirstMatch add reference by name matching for agents via cli args. Only the first match will be used

func WithApplicationByNameFirstMatch

func WithApplicationByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithApplicationByNameFirstMatch add reference by name matching for applications via cli args. Only the first match will be used

func WithCertificateByNameFirstMatch added in v2.13.0

func WithCertificateByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithCertificateByNameFirstMatch add reference by name matching for trusted device certificate via cli args. Only the first match will be used

func WithConfigurationByNameFirstMatch

func WithConfigurationByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithConfigurationByNameFirstMatch add reference by name matching for configuration via cli args. Only the first match will be used

func WithConfigurationFileData added in v2.20.0

func WithConfigurationFileData(factory *cmdutil.Factory, flagConfiguration, flagConfigurationType, flagURL string, args []string, opts ...string) flags.GetOption

WithConfigurationFileData adds configuration information (type, url etc.)

func WithDeviceByNameFirstMatch

func WithDeviceByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithDeviceByNameFirstMatch add reference by name matching for devices via cli args. Only the first match will be used

func WithDeviceGroupByNameFirstMatch

func WithDeviceGroupByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithDeviceGroupByNameFirstMatch add reference by name matching for device groups via cli args. Only the first match will be used

func WithDeviceProfileByNameFirstMatch

func WithDeviceProfileByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithDeviceProfileByNameFirstMatch add reference by name matching for device profile via cli args. Only the first match will be used

func WithDeviceServiceByNameFirstMatch added in v2.16.0

func WithDeviceServiceByNameFirstMatch(factory *cmdutil.Factory, flagDevice string, args []string, opts ...string) flags.GetOption

WithSoftwareVersionByNameFirstMatch add reference by name matching for software version via cli args. Only the first match will be used

func WithExternalCommandByNameFirstMatch added in v2.30.0

func WithExternalCommandByNameFirstMatch(factory *cmdutil.Factory, args []string, externalCommand []string, idPattern string, opts ...string) flags.GetOption

WithSoftwareVersionByNameFirstMatch add reference by name matching for software version via cli args. Only the first match will be used

func WithFirmwareByNameFirstMatch

func WithFirmwareByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithFirmwareByNameFirstMatch add reference by name matching for firmware via cli args. Only the first match will be used

func WithFirmwarePatchByNameFirstMatch

func WithFirmwarePatchByNameFirstMatch(factory *cmdutil.Factory, firmwareFlag string, args []string, opts ...string) flags.GetOption

WithFirmwarePatchByNameFirstMatch add reference by name matching for firmware version via cli args. Only the first match will be used

func WithFirmwareVersionByNameFirstMatch

func WithFirmwareVersionByNameFirstMatch(factory *cmdutil.Factory, flagFirmware string, args []string, opts ...string) flags.GetOption

WithFirmwareVersionByNameFirstMatch add reference by name matching for firmware version via cli args. Only the first match will be used

func WithFirmwareVersionData

func WithFirmwareVersionData(factory *cmdutil.Factory, flagFirmware, flagVersion, flagURL string, args []string, opts ...string) flags.GetOption

WithFirmwareVersionData adds firmware information (name, version and url)

func WithHostedApplicationByNameFirstMatch

func WithHostedApplicationByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithHostedApplicationByNameFirstMatch add reference by name matching for hosted (web) applications via cli args. Only the first match will be used

func WithIDSlice

func WithIDSlice(args []string, opts ...string) flags.GetOption

WithIDSlice adds an id slice from cli arguments

func WithManagedObjectPropertyFirstMatch

func WithManagedObjectPropertyFirstMatch(factory *cmdutil.Factory, fetcher EntityFetcher, args []string, property string, opts ...string) flags.GetOption

WithManagedObjectPropertyFirstMatch add reference by name matching using a fetcher via cli args. Only the first match will be used

func WithMicroserviceByNameFirstMatch

func WithMicroserviceByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithMicroserviceByNameFirstMatch add reference by name matching for microservices via cli args. Only the first match will be used

func WithReferenceByName

func WithReferenceByName(factory *cmdutil.Factory, fetcher EntityFetcher, args []string, opts ...string) flags.GetOption

WithReferenceByName adds support for looking up values by name via cli args

func WithReferenceByNameFirstMatch

func WithReferenceByNameFirstMatch(factory *cmdutil.Factory, fetcher EntityFetcher, args []string, opts ...string) flags.GetOption

WithReferenceByNameFirstMatch add reference by name matching using a fetcher via cli args. Only the first match will be used

func WithRoleByNameFirstMatch

func WithRoleByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithRoleByNameFirstMatch add reference by name matching for roles via cli args. Only the first match will be used

func WithRoleSelfByNameFirstMatch

func WithRoleSelfByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithRoleSelfByNameFirstMatch add reference by name matching for roles' self link via cli args. Only the first match will be used

func WithSelfReferenceByName

func WithSelfReferenceByName(factory *cmdutil.Factory, fetcher EntityFetcher, args []string, opts ...string) flags.GetOption

WithSelfReferenceByName adds support for looking up values by name via cli args

func WithSelfReferenceByNameFirstMatch

func WithSelfReferenceByNameFirstMatch(factory *cmdutil.Factory, fetcher EntityFetcher, args []string, opts ...string) flags.GetOption

WithSelfReferenceByNameFirstMatch add reference by name matching using a fetcher via cli args. Only the first match will be used

func WithSmartGroupByNameFirstMatch

func WithSmartGroupByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithSmartGroupByNameFirstMatch add reference by name matching for smart groups via cli args. Only the first match will be used

func WithSoftwareByNameFirstMatch

func WithSoftwareByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithSoftwareByNameFirstMatch add reference by name matching for software via cli args. Only the first match will be used

func WithSoftwareVersionByNameFirstMatch

func WithSoftwareVersionByNameFirstMatch(factory *cmdutil.Factory, softwareFlag string, args []string, opts ...string) flags.GetOption

WithSoftwareVersionByNameFirstMatch add reference by name matching for software version via cli args. Only the first match will be used

func WithSoftwareVersionData

func WithSoftwareVersionData(factory *cmdutil.Factory, flagSoftware, flagVersion, flagURL string, args []string, opts ...string) flags.GetOption

WithSoftwareVersionData adds software information (name, version and url)

func WithSoftwareVersionUrlByNameFirstMatch

func WithSoftwareVersionUrlByNameFirstMatch(factory *cmdutil.Factory, softwareFlag string, args []string, opts ...string) flags.GetOption

WithSoftwareVersionUrl add software version url

func WithUIPluginByNameFirstMatch added in v2.40.0

func WithUIPluginByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithUIPluginByNameFirstMatch add reference by name matching for UI extensions via cli args. Only the first match will be used

func WithUserByNameFirstMatch

func WithUserByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithUserByNameFirstMatch add reference by name matching for users via cli args. Only the first match will be used

func WithUserGroupByNameFirstMatch

func WithUserGroupByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithUserGroupByNameFirstMatch add reference by name matching for user groups via cli args. Only the first match will be used

func WithUserSelfByNameFirstMatch

func WithUserSelfByNameFirstMatch(factory *cmdutil.Factory, args []string, opts ...string) flags.GetOption

WithUserSelfByNameFirstMatch add reference by name matching for users' self link via cli args. Only the first match will be used

Types

type AgentFetcher

type AgentFetcher struct {
	*CumulocityFetcher
}

func NewAgentFetcher

func NewAgentFetcher(factory *cmdutil.Factory) *AgentFetcher

type ApplicationFetcher

type ApplicationFetcher struct {
	*CumulocityFetcher
}

func NewApplicationFetcher

func NewApplicationFetcher(factory *cmdutil.Factory) *ApplicationFetcher

type ChildAdditionFetcher added in v2.16.0

type ChildAdditionFetcher struct {
	Query QueryFilter
	*DefaultFetcher
	// contains filtered or unexported fields
}

func NewChildAdditionFetcher added in v2.16.0

func NewChildAdditionFetcher(client *c8y.Client, parentID string) *ChildAdditionFetcher

type ConfigurationFetcher

type ConfigurationFetcher struct {
	*ManagedObjectFetcher
}

func NewConfigurationFetcher

func NewConfigurationFetcher(factory *cmdutil.Factory) *ConfigurationFetcher

type CumulocityFetcher added in v2.30.0

type CumulocityFetcher struct {
	*DefaultFetcher
	// contains filtered or unexported fields
}

func (*CumulocityFetcher) Client added in v2.30.0

func (f *CumulocityFetcher) Client() *c8y.Client

type DefaultFetcher

type DefaultFetcher struct{}

func (*DefaultFetcher) IsID

func (f *DefaultFetcher) IsID(v string) bool

type DeviceCertificateFetcher added in v2.13.0

type DeviceCertificateFetcher struct {
	*CumulocityFetcher
	*IDNameFetcher
}

func NewDeviceCertificateFetcher added in v2.13.0

func NewDeviceCertificateFetcher(factory *cmdutil.Factory) *DeviceCertificateFetcher

func (*DeviceCertificateFetcher) IsID added in v2.13.0

func (f *DeviceCertificateFetcher) IsID(id string) bool

type DeviceFetcher

type DeviceFetcher struct {
	*CumulocityFetcher
}

func NewDeviceFetcher

func NewDeviceFetcher(factory *cmdutil.Factory) *DeviceFetcher

type DeviceGroupFetcher

type DeviceGroupFetcher struct {
	*CumulocityFetcher
}

func NewDeviceGroupFetcher

func NewDeviceGroupFetcher(factory *cmdutil.Factory) *DeviceGroupFetcher

type DeviceProfileFetcher

type DeviceProfileFetcher struct {
	*CumulocityFetcher
}

func NewDeviceProfileFetcher

func NewDeviceProfileFetcher(factory *cmdutil.Factory) *DeviceProfileFetcher

type DeviceServiceFetcher added in v2.16.0

type DeviceServiceFetcher struct {
	*ManagedObjectFetcher
}

func NewDeviceServiceFetcher added in v2.16.0

func NewDeviceServiceFetcher(factory *cmdutil.Factory, device string) *DeviceServiceFetcher

type EntityFetcher

type EntityFetcher interface {
	IsID(string) bool
	// contains filtered or unexported methods
}

type EntityIterator

type EntityIterator struct {
	Fetcher EntityFetcher
	Factory *cmdutil.Factory

	GetID          bool
	UseSelfLink    bool
	MinimumMatches int
	OverrideValue  iterator.Iterator
	Format         string
	// contains filtered or unexported fields
}

func NewReferenceByNameIterator

func NewReferenceByNameIterator(fetcher EntityFetcher, factory *cmdutil.Factory, valueIterator iterator.Iterator, minimumMatches int, overrideValue iterator.Iterator, format string) *EntityIterator

NewReferenceByNameIterator create a new iterator which can look up values by their id or names

func (*EntityIterator) GetNext

func (i *EntityIterator) GetNext() (value []byte, input interface{}, err error)

func (*EntityIterator) IsBound

func (i *EntityIterator) IsBound() bool

IsBound return true if the iterator is bound

func (*EntityIterator) MarshalJSON

func (i *EntityIterator) MarshalJSON() (line []byte, err error)

MarshalJSON return the value in a json compatible value

type ExternalFetcher added in v2.30.0

type ExternalFetcher struct {
	IDPattern *regexp.Regexp
	*DefaultFetcher
	// contains filtered or unexported fields
}

func NewExternalFetcher added in v2.30.0

func NewExternalFetcher(externalCommand []string, idPattern string) *ExternalFetcher

func (*ExternalFetcher) IsID added in v2.30.0

func (f *ExternalFetcher) IsID(v string) bool

type FirmwareFetcher

type FirmwareFetcher struct {
	*ManagedObjectFetcher
}

func NewFirmwareFetcher

func NewFirmwareFetcher(factory *cmdutil.Factory) *FirmwareFetcher

type FirmwareVersionFetcher

type FirmwareVersionFetcher struct {
	*ManagedObjectFetcher
}

func NewFirmwareVersionFetcher

func NewFirmwareVersionFetcher(factory *cmdutil.Factory, firmware string, includePatch bool) *FirmwareVersionFetcher

type HostedApplicationFetcher

type HostedApplicationFetcher struct {
	*CumulocityFetcher
	// contains filtered or unexported fields
}

func NewHostedApplicationFetcher

func NewHostedApplicationFetcher(factory *cmdutil.Factory, excludeParentTenant bool) *HostedApplicationFetcher

type IDNameFetcher

type IDNameFetcher struct{}

func (*IDNameFetcher) IsID

func (f *IDNameFetcher) IsID(v string) bool

type ManagedObjectFetcher

type ManagedObjectFetcher struct {
	Query QueryFilter
	*CumulocityFetcher
}

func NewManagedObjectFetcher

func NewManagedObjectFetcher(factory *cmdutil.Factory) *ManagedObjectFetcher

type MicroserviceFetcher

type MicroserviceFetcher struct {
	*CumulocityFetcher

	// Enable the owner check which will only return microservices owned by the current tenant
	// This option was added to ensure that it will not break the existing behaviour,
	// though this option could be enabled by default in the future if it proves to be more useful
	EnableOwnerCheck bool
}

func NewMicroserviceFetcher

func NewMicroserviceFetcher(factory *cmdutil.Factory) *MicroserviceFetcher

type QueryFilter

type QueryFilter func(string) string

type RoleFetcher

type RoleFetcher struct {
	*CumulocityFetcher
	*IDNameFetcher
}

func NewRoleFetcher

func NewRoleFetcher(factory *cmdutil.Factory) *RoleFetcher

type SmartGroupFetcher

type SmartGroupFetcher struct {
	*CumulocityFetcher
}

func NewSmartGroupFetcher

func NewSmartGroupFetcher(factory *cmdutil.Factory) *SmartGroupFetcher

type SoftwareFetcher

type SoftwareFetcher struct {
	*ManagedObjectFetcher
}

func NewSoftwareFetcher

func NewSoftwareFetcher(factory *cmdutil.Factory) *SoftwareFetcher

type SoftwareVersionFetcher

type SoftwareVersionFetcher struct {
	*ManagedObjectFetcher
}

func NewSoftwareVersionFetcher

func NewSoftwareVersionFetcher(factory *cmdutil.Factory, software string) *SoftwareVersionFetcher

type UIPluginFetcher added in v2.40.0

type UIPluginFetcher struct {
	*CumulocityFetcher

	// Look for shared plugins if no local ones are found
	EnableSharedPlugins bool
}

func NewUIPluginFetcher added in v2.40.0

func NewUIPluginFetcher(factory *cmdutil.Factory) *UIPluginFetcher

type UserFetcher

type UserFetcher struct {
	*CumulocityFetcher
	*IDNameFetcher
}

func NewUserFetcher

func NewUserFetcher(factory *cmdutil.Factory) *UserFetcher

type UserGroupFetcher

type UserGroupFetcher struct {
	*CumulocityFetcher
}

func NewUserGroupFetcher

func NewUserGroupFetcher(factory *cmdutil.Factory) *UserGroupFetcher

Jump to

Keyboard shortcuts

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