collect

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseJob

type BaseJob struct {
	// The ID of the connector used in the job.
	ConnectorID string `json:"connectorID"`
	Name        string `json:"name"`
	// The cron schedule, in UTC time format.
	Schedule         string  `json:"schedule"`
	CreateUserID     *string `json:"createUserID,omitempty"`
	CreatedAt        *string `json:"createdAt,omitempty"`
	Id               *string `json:"id,omitempty"`
	LastModifiedAt   *string `json:"lastModifiedAt,omitempty"`
	LastUpdateUserID *string `json:"lastUpdateUserID,omitempty"`
	// Defines whether a job is scheduled or not
	Scheduled *bool   `json:"scheduled,omitempty"`
	Tenant    *string `json:"tenant,omitempty"`
}

type BaseJobPatch

type BaseJobPatch struct {
	// The ID of the connector used in the job.
	ConnectorID *string `json:"connectorID,omitempty"`
	// The job name
	Name *string `json:"name,omitempty"`
	// The configuration of the connector used in the job.
	Parameters  map[string]interface{} `json:"parameters,omitempty"`
	ScalePolicy *ScalePolicy           `json:"scalePolicy,omitempty"`
	// The cron schedule, in UTC time format.
	Schedule *string `json:"schedule,omitempty"`
}

type DeleteJobsResponse

type DeleteJobsResponse struct {
	Count int32 `json:"count"`
}

number of jobs deleted.

type EventExtraField

type EventExtraField struct {
	// Field name
	Name string `json:"name"`
	// Field value
	Value string `json:"value"`
}

type Job

type Job struct {
	// The ID of the connector used in the job.
	ConnectorID string `json:"connectorID"`
	Name        string `json:"name"`
	// The configuration of the connector used in the job.
	Parameters  map[string]interface{} `json:"parameters"`
	ScalePolicy ScalePolicy            `json:"scalePolicy"`
	// The cron schedule, in UTC time format.
	Schedule         string            `json:"schedule"`
	CreateUserID     *string           `json:"createUserID,omitempty"`
	CreatedAt        *string           `json:"createdAt,omitempty"`
	EventExtraFields []EventExtraField `json:"eventExtraFields,omitempty"`
	Id               *string           `json:"id,omitempty"`
	LastModifiedAt   *string           `json:"lastModifiedAt,omitempty"`
	LastUpdateUserID *string           `json:"lastUpdateUserID,omitempty"`
	// Defines whether a job is scheduled or not
	Scheduled *bool   `json:"scheduled,omitempty"`
	Tenant    *string `json:"tenant,omitempty"`
}

type JobPatch

type JobPatch struct {
	// The ID of the connector used in the job.
	ConnectorID      *string           `json:"connectorID,omitempty"`
	EventExtraFields []EventExtraField `json:"eventExtraFields,omitempty"`
	// The job name
	Name *string `json:"name,omitempty"`
	// The configuration of the connector used in the job.
	Parameters  map[string]interface{} `json:"parameters,omitempty"`
	ScalePolicy *ScalePolicy           `json:"scalePolicy,omitempty"`
	// The cron schedule, in UTC time format.
	Schedule *string `json:"schedule,omitempty"`
	// Defines wheather a job is scheduled or not
	Scheduled *bool `json:"scheduled,omitempty"`
}

type JobsPatch

type JobsPatch struct {
	// The ID of the connector used in the job.
	ConnectorID      *string           `json:"connectorID,omitempty"`
	EventExtraFields []EventExtraField `json:"eventExtraFields,omitempty"`
	ScalePolicy      *ScalePolicy      `json:"scalePolicy,omitempty"`
}

type ListJobsQueryParams

type ListJobsQueryParams struct {
	// ConnectorId : Specifies the connector ID used to filter jobs. A tailing wildcard is supported for the connector ID tag. If no wildcard is used then an exact match is used. Examples: * `my-connector:v1.0.0` selects `my-connector` connector with an exact match with tag \"v1.0.0\" * `my-connector` selects `my-connector` connector with an exact match. Note as no tag is specified it actually refers to \"latest\". * `my-connector:v1.*` selects all `my-connector` connectors with tags starting with \"v1.\", e.g. \"v1.0\", \"v1.1.1\", \"v1.2-alpha\", etc. * `my-connector:*` selects all `my-connector` connectors with any tag.
	ConnectorId string `key:"connectorID"`
}

ListJobsQueryParams represents valid query parameters for the ListJobs operation For convenience ListJobsQueryParams can be formed in a single statement, for example:

`v := ListJobsQueryParams{}.SetConnectorId(...)`

func (ListJobsQueryParams) SetConnectorId

func (q ListJobsQueryParams) SetConnectorId(v string) ListJobsQueryParams

type ListJobsResponse

type ListJobsResponse struct {
	Data []BaseJob `json:"data,omitempty"`
}

List of job summaries i.e. scheduling informations, owner, updates, connector.

type Metadata

type Metadata struct {
	// The number of jobs that failed to update.
	Failures int64 `json:"failures"`
	// The number of jobs which match the query criteria.
	TotalMatchJobs int64 `json:"totalMatchJobs"`
}

The metadata for the patch jobs operation.

type ModelError

type ModelError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	// The optional details of the error.
	Details map[string]interface{} `json:"details,omitempty"`
	// An optional link to a web page with more information on the error.
	MoreInfo *string `json:"moreInfo,omitempty"`
}

type PatchJobResult

type PatchJobResult struct {
	// The Job ID.
	Id string `json:"id"`
	// Successfully updated or not.
	Updated bool        `json:"updated"`
	Error   *ModelError `json:"error,omitempty"`
}

type PatchJobsQueryParams

type PatchJobsQueryParams struct {
	// ConnectorId : Specifies the connector ID used to filter jobs. A tailing wildcard is supported for the connector ID tag. If no wildcard is used then an exact match is used. Examples: * `my-connector:v1.0.0` selects `my-connector` connector with an exact match with tag \"v1.0.0\" * `my-connector` selects `my-connector` connector with an exact match. Note as no tag is specified it actually refers to \"latest\". * `my-connector:v1.*` selects all `my-connector` connectors with tags starting with \"v1.\", e.g. \"v1.0\", \"v1.1.1\", \"v1.2-alpha\", etc. * `my-connector:*` selects all `my-connector` connectors with any tag.
	ConnectorId string `key:"connectorID"`
	// JobIDs : The job ID list.
	JobIDs []string `key:"jobIDs"`
}

PatchJobsQueryParams represents valid query parameters for the PatchJobs operation For convenience PatchJobsQueryParams can be formed in a single statement, for example:

`v := PatchJobsQueryParams{}.SetConnectorId(...).SetJobIDs(...)`

func (PatchJobsQueryParams) SetConnectorId

func (q PatchJobsQueryParams) SetConnectorId(v string) PatchJobsQueryParams

func (PatchJobsQueryParams) SetJobIDs

type PatchJobsResponse

type PatchJobsResponse struct {
	Data     []PatchJobResult `json:"data"`
	Metadata Metadata         `json:"metadata"`
}

type ScalePolicy

type ScalePolicy struct {
	Static StaticScale `json:"static"`
}

type Service

type Service services.BaseService

func NewService

func NewService(config *services.Config) (*Service, error)

NewService creates a new collect service client from the given Config

func (*Service) CreateJob

func (s *Service) CreateJob(job Job, resp ...*http.Response) (*SingleJobResponse, error)

CreateJob - Creates a job This API returns `403` if the number of collect workers is over a certain limit. Parameters:

job: The API request schema for the job.
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided

func (*Service) DeleteJob

func (s *Service) DeleteJob(jobId string, resp ...*http.Response) error

DeleteJob - Removes a job based on the job ID. Parameters:

jobId: The job ID.
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided

func (*Service) DeleteJobs

func (s *Service) DeleteJobs(resp ...*http.Response) (*DeleteJobsResponse, error)

DeleteJobs - Removes all jobs on a tenant. Parameters:

resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided

func (*Service) GetJob

func (s *Service) GetJob(jobId string, resp ...*http.Response) (*SingleJobResponse, error)

GetJob - Returns a job based on the job ID. Parameters:

jobId: The job ID.
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided

func (*Service) ListJobs

func (s *Service) ListJobs(query *ListJobsQueryParams, resp ...*http.Response) (*ListJobsResponse, error)

ListJobs - Returns a list of all jobs that belong to a tenant. Parameters:

query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided

func (*Service) PatchJob

func (s *Service) PatchJob(jobId string, jobPatch JobPatch, resp ...*http.Response) (*SingleJobResponse, error)

PatchJob - Modifies a job based on the job ID. This API returns `403` if the number of collect workers is over a certain limit. Parameters:

jobId: The job ID.
jobPatch: The API request schema for patching a job.
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided

func (*Service) PatchJobs

func (s *Service) PatchJobs(jobsPatch JobsPatch, query *PatchJobsQueryParams, resp ...*http.Response) (*PatchJobsResponse, error)

PatchJobs - Finds all jobs that match the query and modifies the with the changes specified in the request. This is a non-atomic operation and the results are returned as a list with each job patch result as its element. This API returns `200 OK` regardless of how many jobs were successfully patched. You must read the response body to find out if all jobs are patched. When the API is called, the `jobIDs` or `connectorID` must be specified. Do not specify more than one of them at the same time. This API returns `403` if the number of collect workers is over a certain limit. Parameters:

jobsPatch: The API request schema for patching jobs.
query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters
resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided

type Servicer

type Servicer interface {
	/*
		CreateJob - Creates a job
		This API returns `403` if the number of collect workers is over a certain limit.
		Parameters:
			job: The API request schema for the job.
			resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
	*/
	CreateJob(job Job, resp ...*http.Response) (*SingleJobResponse, error)
	/*
		DeleteJob - Removes a job based on the job ID.
		Parameters:
			jobId: The job ID.
			resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
	*/
	DeleteJob(jobId string, resp ...*http.Response) error
	/*
		DeleteJobs - Removes all jobs on a tenant.
		Parameters:
			resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
	*/
	DeleteJobs(resp ...*http.Response) (*DeleteJobsResponse, error)
	/*
		GetJob - Returns a job based on the job ID.
		Parameters:
			jobId: The job ID.
			resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
	*/
	GetJob(jobId string, resp ...*http.Response) (*SingleJobResponse, error)
	/*
		ListJobs - Returns a list of all jobs that belong to a tenant.
		Parameters:
			query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters
			resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
	*/
	ListJobs(query *ListJobsQueryParams, resp ...*http.Response) (*ListJobsResponse, error)
	/*
		PatchJob - Modifies a job based on the job ID.
		This API returns `403` if the number of collect workers is over a certain limit.
		Parameters:
			jobId: The job ID.
			jobPatch: The API request schema for patching a job.
			resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
	*/
	PatchJob(jobId string, jobPatch JobPatch, resp ...*http.Response) (*SingleJobResponse, error)
	/*
		PatchJobs - Finds all jobs that match the query and modifies the with the changes specified in the request.
		This is a non-atomic operation and the results are returned as a list with each job patch result as its element. This API returns `200 OK` regardless of how many jobs were successfully patched. You must read the response body to find out if all jobs are patched. When the API is called, the `jobIDs` or `connectorID` must be specified. Do not specify more than one of them at the same time. This API returns `403` if the number of collect workers is over a certain limit.
		Parameters:
			jobsPatch: The API request schema for patching jobs.
			query: a struct pointer of valid query parameters for the endpoint, nil to send no query parameters
			resp: an optional pointer to a http.Response to be populated by this method. NOTE: only the first resp pointer will be used if multiple are provided
	*/
	PatchJobs(jobsPatch JobsPatch, query *PatchJobsQueryParams, resp ...*http.Response) (*PatchJobsResponse, error)
}

Servicer represents the interface for implementing all endpoints for this service

type SingleJobResponse

type SingleJobResponse struct {
	Data Job `json:"data"`
}

type StaticScale

type StaticScale struct {
	// The number of collect workers.
	Workers int32 `json:"workers"`
}

Jump to

Keyboard shortcuts

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