Documentation ¶
Overview ¶
Copyright 2018 Northern.tech AS
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 ( // orchestrator endpoint DeviceDecommissioningOrchestratorUri = "/api/workflow/decommission_device" ProvisionDeviceOrchestratorUri = "/api/workflow/provision_device" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an opaque implementation of orchestrator client. Implements ClientRunner interface
func (*Client) SubmitDeviceDecommisioningJob ¶
func (co *Client) SubmitDeviceDecommisioningJob(ctx context.Context, decommissioningReq DecommissioningReq) error
func (*Client) SubmitProvisionDeviceJob ¶
func (co *Client) SubmitProvisionDeviceJob(ctx context.Context, provisionDeviceReq ProvisionDeviceReq) error
type ClientRunner ¶
type ClientRunner interface { SubmitDeviceDecommisioningJob(ctx context.Context, req DecommissioningReq) error SubmitProvisionDeviceJob(ctx context.Context, req ProvisionDeviceReq) error }
ClientRunner is an interface of orchestrator client
type Config ¶
type Config struct { // Orchestrator host OrchestratorAddr string // Request timeout Timeout time.Duration }
Config conveys client configuration
type DecommissioningReq ¶
type DecommissioningReq struct { // Device ID DeviceId string `json:"device_id"` // Request ID RequestId string `json:"request_id"` // User authorization, eg. the value of Authorization header of incoming // HTTP request Authorization string `json:"authorization"` }
DecomissioningReq contains request data of request to start decommissioning workflow
type ProvisionDeviceReq ¶
type ProvisionDeviceReq struct { // Request ID RequestId string `json:"request_id"` // User authorization, eg. the value of Authorization header of incoming // HTTP request Authorization string `json:"authorization"` // Device Device model.Device `json:"device"` }
ProvisionDeviceReq contains request data of request to start provisioning workflow
Click to show internal directories.
Click to hide internal directories.