pluginapiovh

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

README

apiovh Plugin

This plugin makes calls to the Public API of OVHCloud: https://api.ovh.com.

Configuration

Field Description
path http route + query params
method http method (GET/POST/PUT/DELETE)
body a string representing the payload to be sent with the request
credentials a key to retrieve credentials from configstore

Example

An action of type apiovh requires the following kind of configuration. The body field is optional:

action:
  type: apiovh
  configuration:
    method: POST
    path: /dbaas/logs/{{.input.serviceName}}/output/graylog/stream
    credendials: ovh-api-credentials
    # body is optional, not used for method GET
    body: | 
      {
        "title": "{{.input.applicationName}}",
        "description": "{{.input.applicationDescription}}",  
        "autoSelectOption": true
      }

Requirements

The apiovh plugin requires a config item to be found under the key given in the credentials config field. It's content should match the following schema (see go-ovh for more details):

{
  "endpoint": "ovh-eu",
  "appKey": "XXXX",
  "appSecret": "YYYY",
  "consumerKey": "ZZZZ"
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Plugin = taskplugin.New("apiovh", "0.6", exec,
		taskplugin.WithConfig(validConfig, APIOVHConfig{}),
		taskplugin.WithExecutorMetadata(ExecutorMetadata),
	)
)

the apiovh plugin performs signed http calls on the OVH public API

Functions

func ExecutorMetadata

func ExecutorMetadata() string

ExecutorMetadata generates json schema for the metadata returned by the executor

Types

type APIOVHConfig

type APIOVHConfig struct {
	Credentials string `json:"credentials"`
	Method      string `json:"method"`
	Path        string `json:"path"`
	Body        string `json:"body,omitempty"`
}

APIOVHConfig holds the configuration needed to run the apiovh plugin credentials: key to retrieve credentials from configstore method: http method path: http path body: http body (optional)

Jump to

Keyboard shortcuts

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