cli

package
v4.16.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 90 Imported by: 1

Documentation

Overview

DigitalRebar Provision CLI provides the core parts of the CLI. This CLI uses an access core based upon a set of generated files from the generated swagger.json file.

Copyright © 2020 RackN <support@rackn.com>

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

View Source
const (
	AgentConfigFileName = "agent-cfg.yml"
	AgentConfigFileMode = 0600
)

Variables

View Source
var (
	// ActuallyPowerThings is a boolean to use in testing to keep from power off the test machine
	ActuallyPowerThings = true
	// DefaultStateLoc is the default location to save agent state
	DefaultStateLoc string
	AgentName       = "drp-agent"
)

AllKinds is the canonical list of reference kinds. Add new kinds here and they’ll automatically be picked up everywhere.

View Source
var AllowedCallsFields = map[string]info{

	"Param":              {/* contains filtered or unexported fields */},
	"ParamExists":        {/* contains filtered or unexported fields */},
	"ParamExpand":        {/* contains filtered or unexported fields */},
	"ParamAsJSON":        {/* contains filtered or unexported fields */},
	"ParamAsYAML":        {/* contains filtered or unexported fields */},
	"ParamCompose":       {/* contains filtered or unexported fields */},
	"ParamComposeExpand": {/* contains filtered or unexported fields */},
	"ComposeParam":       {/* contains filtered or unexported fields */},
	"ExpandParam":        {/* contains filtered or unexported fields */},

	"CallTemplate": {/* contains filtered or unexported fields */},

	"CurrentJob":                   {/* contains filtered or unexported fields */},
	"GenerateInfiniteToken":        {/* contains filtered or unexported fields */},
	"GenerateCreateOrMachineToken": {/* contains filtered or unexported fields */},
	"GenerateInfiniteMachineToken": {/* contains filtered or unexported fields */},
	"GenerateJobToken":             {/* contains filtered or unexported fields */},
	"GenerateToken":                {/* contains filtered or unexported fields */},
	"GenerateUserToken":            {/* contains filtered or unexported fields */},
	"GenerateProfileToken":         {/* contains filtered or unexported fields */},
	"BootParams":                   {/* contains filtered or unexported fields */},
	"ProvisionerAddress":           {/* contains filtered or unexported fields */},
	"ProvisionerURL":               {/* contains filtered or unexported fields */},
	"ProvisionerHostURL":           {/* contains filtered or unexported fields */},
	"SecureProvisionerURL":         {/* contains filtered or unexported fields */},
	"SecureProvisionerHostURL":     {/* contains filtered or unexported fields */},
	"BootParamsFor":                {/* contains filtered or unexported fields */},
	"ApiURL":                       {/* contains filtered or unexported fields */},
	"MachineRepos":                 {/* contains filtered or unexported fields */},
	"InstallRepos":                 {/* contains filtered or unexported fields */},
	"Tasks":                        {/* contains filtered or unexported fields */},
	"CurrentTask":                  {/* contains filtered or unexported fields */},
	"NetmaskToCIDR":                {/* contains filtered or unexported fields */},

	"Machine": {
		// contains filtered or unexported fields
	},

	"Env": {
		// contains filtered or unexported fields
	},

	"WorkOrder": {
		// contains filtered or unexported fields
	},

	"ObjectExpand": {/* contains filtered or unexported fields */},
	"StringExpand": {/* contains filtered or unexported fields */},

	"ServerPathInfo": {
		// contains filtered or unexported fields
	},

	"Info": {
		// contains filtered or unexported fields
	},
}
View Source
var (

	// Session is the global client access session
	Session *api.Client
)

Functions

func AddDirToZip

func AddDirToZip(zipWriter *zip.Writer, dirname string) error

given a top level dir this will walk it adding files and folders. to the archive

func AddFileToZip

func AddFileToZip(zipWriter *zip.Writer, filename string) error

adds an individual file to the archive

func NewApp

func NewApp() *cobra.Command

NewApp is the app start function

func NewBasicKeyRequest

func NewBasicKeyRequest() *basicKeyReq

NewBasicKeyRequest returns a default BasicKeyRequest.

func PatchWithFunction

func PatchWithFunction(key string, op *ops, fn func(models.Model) (models.Model, bool)) error

The input function takes the object and returns the modified object and if the object changed.

func PatchWithString

func PatchWithString(key, js string, op *ops) error

func ResetDefaults

func ResetDefaults()

Types

type DocData

type DocData struct {
	Name          string
	Prefix        string
	RefName       string
	RefPrefix     string
	DisplayName   string
	Full          string
	Version       string
	Documentation string
	Description   string
	Content       string
	RefString     string
	Objects       [][]models.Model
}

func (*DocData) LengthString

func (dd *DocData) LengthString(str, pat string) string

func (*DocData) PrefixToTag added in v4.12.0

func (dd *DocData) PrefixToTag() string

type Item added in v4.15.0

type Item struct {
	Name         string
	Version      string
	CatalogEntry *models.CatalogItem
}

type LabDocData added in v4.10.0

type LabDocData struct {
	Lab        *models.Lab
	LabSection *models.LabSection
	Depth      int
	InTab      bool
	VideoTag   string
	VideoTime  string
}

func (*LabDocData) Encapsulate added in v4.10.0

func (dd *LabDocData) Encapsulate(str, first, pat string) string

func (*LabDocData) GenerateLabMd added in v4.13.0

func (dd *LabDocData) GenerateLabMd() string

func (*LabDocData) GenerateSectionMarkdown added in v4.13.0

func (dd *LabDocData) GenerateSectionMarkdown(section *models.LabSection, depth int, inTab bool) string

func (*LabDocData) LengthString added in v4.10.0

func (dd *LabDocData) LengthString(str, pat string) string

func (*LabDocData) MarkdownToRst added in v4.10.0

func (dd *LabDocData) MarkdownToRst(data string) string

func (*LabDocData) RenderSection added in v4.10.0

func (dd *LabDocData) RenderSection(tmplFile string, ls *models.LabSection, depth int, tab string) string

func (*LabDocData) StringCleanup added in v4.13.0

func (dd *LabDocData) StringCleanup(str string) string

StringCleanup removes new lines and replaces them with a single space. Also doesn't change it if it contains a table.

func (*LabDocData) ToRef added in v4.10.0

func (dd *LabDocData) ToRef(names ...string) string

type Output added in v4.16.0

type Output struct {
	Index    map[RefKind]map[string][]RefLoc `json:"index"`
	RevIndex map[RefKind]map[string][]RefLoc `json:"rev_index"`
	Summary  struct {
		Packs           int `json:"packs"`
		Objects         int `json:"objects"`
		TemplateRefs    int `json:"templateRefs"`
		ParamRefs       int `json:"paramRefs"`
		StageRefs       int `json:"stageRefs"`
		TaskRefs        int `json:"taskRefs"`
		BootenvRefs     int `json:"bootenvRefs"`
		ContextRefs     int `json:"contextRefs"`
		ProfileRefs     int `json:"profileRefs"`
		UniqueTemplates int `json:"uniqueTemplates"`
		UniqueParams    int `json:"uniqueParams"`
		UniqueProfiles  int `json:"uniqueProfiles"`
	} `json:"summary"`
}

Output aggregates a normalized reverse index and summary

type PackID added in v4.16.0

type PackID struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

PackID identifies a content pack

type RefKind added in v4.16.0

type RefKind string

Normalized kinds for a unified index

const (
	KindTemplate  RefKind = "templates"
	KindParam     RefKind = "params"
	KindStage     RefKind = "stages"
	KindTask      RefKind = "tasks"
	KindBootEnv   RefKind = "bootenvs"
	KindContext   RefKind = "contexts"
	KindProfile   RefKind = "profiles"
	KindWorkflow  RefKind = "workflows"
	KindBlueprint RefKind = "blueprints"
	KindTrigger   RefKind = "triggers"
)

type RefLoc added in v4.16.0

type RefLoc struct {
	Pack       PackID      `json:"pack"`
	Section    string      `json:"section"`
	ObjectName string      `json:"objectName"`
	FieldPath  string      `json:"fieldPath"`
	Via        string      `json:"via"`
	Value      interface{} `json:"value"`
}

RefLoc points to a specific field in an object

type Service added in v4.9.3

type Service struct {
	Service string
	Port    string
}

type Services added in v4.9.3

type Services struct {
	Services []Service
	Warnings []Warning
}

type Warning added in v4.9.3

type Warning struct {
	Service string
	Port    string
	Warn    string
}

Jump to

Keyboard shortcuts

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