key

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package key represents our SiteHost `/ssh/key` API endpoint.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a Service to work with API Jobs.

func New

func New(c *api.Client) *Client

New is an initialisation function.

func (*Client) Create added in v0.3.3

func (s *Client) Create(ctx context.Context, opts CreateRequest) (response CreateResponse, err error)

Create an SSH Key.

func (*Client) Delete added in v0.3.3

func (s *Client) Delete(ctx context.Context, request DeleteRequest) (response DeleteResponse, err error)

Delete an SSH Key with the provided ID.

func (*Client) Get added in v0.3.3

func (s *Client) Get(ctx context.Context, request GetRequest) (response GetResponse, err error)

Get information about the SSH Key.

func (*Client) List

func (s *Client) List(ctx context.Context) (response ListResponse, err error)

List returns a list of all ssh keys.

func (*Client) Update added in v0.3.4

func (s *Client) Update(ctx context.Context, opts UpdateRequest) (response UpdateResponse, err error)

Update an SSH Key.

type CreateRequest added in v0.3.3

type CreateRequest struct {
	Label             string `json:"label"`
	Content           string `json:"content"`
	CustomImageAccess bool   `json:"custom_image_access"`
}

CreateRequest represents a request to create an SSH Key.

type CreateResponse added in v0.3.3

type CreateResponse struct {
	Return struct {
		KeyID string `json:"key_id"`
	} `json:"return"`
	models.APIResponse
}

CreateResponse represents a result of creating an SSH key.

type DeleteRequest added in v0.3.3

type DeleteRequest struct {
	ID string `json:"key_id"`
}

DeleteRequest represents a request to delete a specific SSH Key.

type DeleteResponse added in v0.3.3

type DeleteResponse struct {
	models.APIResponse
}

DeleteResponse represents the result of deleting an SSH key.

type GetRequest

type GetRequest struct {
	ID string `json:"key_id"`
}

GetRequest represents a request to get a specific SSH Key.

type GetResponse added in v0.3.3

type GetResponse struct {
	Return models.SSHKey `json:"return"`
	models.APIResponse
}

GetResponse represents a SSH Keys information.

type ListResponse

type ListResponse struct {
	Return struct {
		models.Pagination
		SSHKeys []models.SSHKey `json:"data"`
	} `json:"return"`
	models.APIResponse
}

ListResponse represents the listing of SSH keys.

type UpdateRequest added in v0.3.4

type UpdateRequest struct {
	ID                string `json:"key_id"`
	Label             string `json:"label"`
	Content           string `json:"content"`
	CustomImageAccess bool   `json:"custom_image_access"`
}

UpdateRequest represents a request to update a specific SSH Key.

type UpdateResponse added in v0.3.4

type UpdateResponse struct {
	models.APIResponse
}

UpdateResponse represents a result of updating an SSH key.

Jump to

Keyboard shortcuts

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