tms

package
v1.358.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

View Source
const CALM_REROUTING_ENDPOINT_TO_CTMS = "/imp-cdm-transport-management-api/v1"
View Source
const DEFAULT_TR_DESCRIPTION = "Created by Piper"

Variables

This section is empty.

Functions

func FormNodeIdExtDescriptorMappingWithValidation added in v1.280.0

func FormNodeIdExtDescriptorMappingWithValidation(utils TmsUtils, nodeNameExtDescriptorMapping map[string]interface{}, nodes []Node, mtaYamlMap map[string]interface{}, mtaVersion string) (map[int64]string, error)

func GetYamlAsMap added in v1.280.0

func GetYamlAsMap(utils TmsUtils, yamlPath string) (map[string]interface{}, error)

func UploadDescriptors added in v1.280.0

func UploadDescriptors(config Options, communicationInstance CommunicationInterface, utils TmsUtils) error

Types

type CommunicationInstance

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

func NewCommunicationInstance

func NewCommunicationInstance(httpClient piperHttp.Uploader, tmsUrl, uaaUrl, clientId, clientSecret string, isVerbose bool, clientOptions piperHttp.ClientOptions) (*CommunicationInstance, error)

NewCommunicationInstance returns CommunicationInstance structure with http client prepared for communication with TMS backend

func (*CommunicationInstance) ExportFileToNode added in v1.280.0

func (communicationInstance *CommunicationInstance) ExportFileToNode(fileInfo FileInfo, nodeName, description, namedUser string) (NodeUploadResponseEntity, error)

func (*CommunicationInstance) GetMtaExtDescriptor

func (communicationInstance *CommunicationInstance) GetMtaExtDescriptor(nodeId int64, mtaId, mtaVersion string) (MtaExtDescriptor, error)

func (*CommunicationInstance) GetNodes

func (communicationInstance *CommunicationInstance) GetNodes() ([]Node, error)

func (*CommunicationInstance) UpdateMtaExtDescriptor

func (communicationInstance *CommunicationInstance) UpdateMtaExtDescriptor(nodeId, idOfMtaExtDescriptor int64, file, mtaVersion, description, namedUser string) (MtaExtDescriptor, error)

func (*CommunicationInstance) UploadFile

func (communicationInstance *CommunicationInstance) UploadFile(file, namedUser string) (FileInfo, error)

func (*CommunicationInstance) UploadFileToNode

func (communicationInstance *CommunicationInstance) UploadFileToNode(fileInfo FileInfo, nodeName, description, namedUser string) (NodeUploadResponseEntity, error)

func (*CommunicationInstance) UploadMtaExtDescriptorToNode

func (communicationInstance *CommunicationInstance) UploadMtaExtDescriptorToNode(nodeId int64, file, mtaVersion, description, namedUser string) (MtaExtDescriptor, error)

type CommunicationInterface

type CommunicationInterface interface {
	GetNodes() ([]Node, error)
	GetMtaExtDescriptor(nodeId int64, mtaId, mtaVersion string) (MtaExtDescriptor, error)
	UpdateMtaExtDescriptor(nodeId, idOfMtaExtDescriptor int64, file, mtaVersion, description, namedUser string) (MtaExtDescriptor, error)
	UploadMtaExtDescriptorToNode(nodeId int64, file, mtaVersion, description, namedUser string) (MtaExtDescriptor, error)
	UploadFile(file, namedUser string) (FileInfo, error)
	UploadFileToNode(fileInfo FileInfo, nodeName, description, namedUser string) (NodeUploadResponseEntity, error)
	ExportFileToNode(fileInfo FileInfo, nodeName, description, namedUser string) (NodeUploadResponseEntity, error)
}

func SetupCommunication added in v1.280.0

func SetupCommunication(config Options) (communicationInstance CommunicationInterface)

type Entry

type Entry struct {
	Uri string `json:"uri"`
}

type FileInfo

type FileInfo struct {
	Id   int64  `json:"fileId"`
	Name string `json:"fileName"`
}

func UploadFile added in v1.280.0

func UploadFile(config Options, communicationInstance CommunicationInterface, utils TmsUtils) (FileInfo, error)

type MtaExtDescriptor

type MtaExtDescriptor struct {
	Id            int64  `json:"id"`
	Description   string `json:"description"`
	MtaId         string `json:"mtaId"`
	MtaExtId      string `json:"mtaExtId"`
	MtaVersion    string `json:"mtaVersion"`
	LastChangedAt string `json:"lastChangedAt"`
}

type Node

type Node struct {
	Id   int64  `json:"id"`
	Name string `json:"name"`
}

type NodeUploadRequestEntity

type NodeUploadRequestEntity struct {
	ContentType string  `json:"contentType"`
	StorageType string  `json:"storageType"`
	NodeName    string  `json:"nodeName"`
	Description string  `json:"description"`
	NamedUser   string  `json:"namedUser"`
	Entries     []Entry `json:"entries"`
}

type NodeUploadResponseEntity

type NodeUploadResponseEntity struct {
	TransportRequestId          int64        `json:"transportRequestId"`
	TransportRequestDescription string       `json:"transportRequestDescription"`
	QueueEntries                []QueueEntry `json:"queueEntries"`
}

type Options added in v1.280.0

type Options struct {
	ServiceKey               string
	CustomDescription        string
	NamedUser                string
	NodeName                 string
	MtaPath                  string
	MtaVersion               string
	NodeExtDescriptorMapping map[string]interface{}
	Proxy                    string
	StashContent             []string
	Verbose                  bool
}

type QueueEntry

type QueueEntry struct {
	Id       int64  `json:"queueId"`
	NodeId   int64  `json:"nodeId"`
	NodeName string `json:"nodeName"`
}

type TmsUtils added in v1.280.0

type TmsUtils interface {
	command.ExecRunner
	FileExists(filename string) (bool, error)
	FileRead(path string) ([]byte, error)
}

func NewTmsUtils added in v1.280.0

func NewTmsUtils() TmsUtils

Jump to

Keyboard shortcuts

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