Documentation ¶
Index ¶
- Variables
- func WaitUntilFinishedTask[T Element](ctx context.Context, client *Client, workspaceID, elementID string, ...) (T, bool)
- type Client
- func (c *Client) CreateAccount(ctx context.Context, payload models.Account) (*models.Account, error)
- func (c *Client) CreateAttachment(ctx context.Context, payload models.CreateAttachment, workspaceID string, ...) (*models.Attachment, error)
- func (c *Client) CreateNode(ctx context.Context, payload models.CreateNode, workspaceID string, ...) (*models.Node, error)
- func (c *Client) CreatePhysicalPort(ctx context.Context, payload models.CreatePhysicalPort) (*models.PhysicalPort, error)
- func (c *Client) CreateTransport(ctx context.Context, payload models.CreateTransport, workspaceID string, ...) (*models.Transport, error)
- func (c *Client) CreateUser(ctx context.Context, payload models.CreateUser) (*models.User, error)
- func (c *Client) CreateWorkspace(ctx context.Context, payload models.CreateWorkspace) (*models.Workspace, error)
- func (c *Client) DeleteAccount(ctx context.Context, accountID uuid.UUID) error
- func (c *Client) DeleteAttachment(ctx context.Context, workspaceID, attachmentID string, ...) (*models.Attachment, error)
- func (c *Client) DeleteNode(ctx context.Context, workspaceID, nodeID string, options ...OptionElement) (*models.Node, error)
- func (c *Client) DeletePhysicalPort(ctx context.Context, physicalPortID string) error
- func (c *Client) DeleteTransport(ctx context.Context, workspaceID, transportID string, options ...OptionElement) (*models.Transport, error)
- func (c *Client) DeleteUser(ctx context.Context, userID string) error
- func (c *Client) DeleteWorkspace(ctx context.Context, workspaceID string) error
- func (c *Client) GetAttachment(ctx context.Context, workspaceID, attachmentID string) (*models.Attachment, error)
- func (c *Client) GetNode(ctx context.Context, workspaceID, nodeID string) (*models.Node, error)
- func (c *Client) GetPhysicalPort(ctx context.Context, portID string) (*models.PhysicalPort, error)
- func (c *Client) GetSelf() (uuid.UUID, error)
- func (c *Client) GetTransport(ctx context.Context, workspaceID, transportID string) (*models.Transport, error)
- func (c *Client) GetWorkspace(ctx context.Context, workspaceID string) (*models.Workspace, error)
- func (c *Client) ListAccounts(ctx context.Context) (models.Accounts, error)
- func (c *Client) ListPort(options ...OptionElement) (*[]models.PhysicalPort, error)
- func (c *Client) ListUsers(ctx context.Context, accountID uuid.UUID) (models.Users, error)
- func (c *Client) ListWorkspaces(ctx context.Context, accountID uuid.UUID) ([]models.Workspace, error)
- func (c *Client) UpdateNode(ctx context.Context, payload models.UpdateElement, workspaceID, nodeID string) (*models.Node, error)
- func (c *Client) UpdateTransport(ctx context.Context, payload models.UpdateElement, ...) (*models.Transport, error)
- func (c *Client) UpdateWorkspace(ctx context.Context, payload models.UpdateWorkspace, workspaceID string) (*models.Workspace, error)
- type Element
- type OptionClient
- type OptionElement
Constants ¶
This section is empty.
Variables ¶
var ( ErrTermsAndConditionsRequired = errors.New("terms and conditions must be accepted") ErrHostURLRequired = errors.New("host url must be set, please use the option WithHostURL()") ErrPersonalAccessTokenRequired = errors.New("personal acess token must be set, please use the option WithPersonalAccessToken()") )
Functions ¶
func WaitUntilFinishedTask ¶ added in v0.0.11
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(termsAndConditions bool, opts ...OptionClient) (*Client, error)
NewClient - Init and return an http client
func (*Client) CreateAccount ¶ added in v1.2.0
func (*Client) CreateAttachment ¶ added in v0.0.7
func (c *Client) CreateAttachment(ctx context.Context, payload models.CreateAttachment, workspaceID string, options ...OptionElement) (*models.Attachment, error)
CreateAttachment creates asynchronously an attachment. The attachment returned will depend of the passed option. If none is passed the attachment will be returned once created in database with administrative state creation_pending. If the option WithWaitUntilElementDeployed() is passed, the attachment will be returned when its state reach deployed or creation_error. If the option WithWaitUntilElementUndeployed() is passed, it will not be considered hence the attachment returned will be in state creation_pending
func (*Client) CreateNode ¶
func (c *Client) CreateNode(ctx context.Context, payload models.CreateNode, workspaceID string, options ...OptionElement) (*models.Node, error)
CreateNode creates asynchronously a cloud node. The node returned will depend of the passed option. If none is passed the node will be returned once created in database with administrative state creation_pending. If the option WithWaitUntilElementDeployed() is passed, the node will be returned when its state reach deployed or creation_error. If the option WithWaitUntilElementUndeployed() is passed, it will not be considered hence the node returned will be in state creation_pending
func (*Client) CreatePhysicalPort ¶ added in v0.0.14
func (c *Client) CreatePhysicalPort(ctx context.Context, payload models.CreatePhysicalPort) (*models.PhysicalPort, error)
CreatePhysicalPort creates a physical port in Autonomi platform.
func (*Client) CreateTransport ¶ added in v0.0.4
func (c *Client) CreateTransport(ctx context.Context, payload models.CreateTransport, workspaceID string, options ...OptionElement) (*models.Transport, error)
CreateTransport creates asynchronously a transport. The transport returned will depend of the passed option. If none is passed the transport will be returned once created in database with administrative state creation_pending. If the option WithWaitUntilElementDeployed() is passed, the transport will be returned when its state reach deployed or creation_error. If the option WithWaitUntilElementUndeployed() is passed, it will not be considered hence the transport returned will be in state creation_pending
func (*Client) CreateUser ¶ added in v1.3.0
func (*Client) CreateWorkspace ¶
func (*Client) DeleteAccount ¶ added in v1.2.0
func (*Client) DeleteAttachment ¶ added in v0.0.7
func (c *Client) DeleteAttachment(ctx context.Context, workspaceID, attachmentID string, options ...OptionElement) (*models.Attachment, error)
DeleteAttachment deletes asynchronously an attachment. The attachment returned will depend of the option passed. If none is passed the attachment will be returned once the request accepted, its state will be delete_pending If the option WithWaitUntilElementUndeployed() is passed, the attachment won't be returned as it would have been deleted. However, if an error is triggered, an object could be returned with a delete_error state. If the option WithWaitUntilElementDeployed() is passed, it will not be considered hence the attachment returned will be in state delete_pending
func (*Client) DeleteNode ¶
func (c *Client) DeleteNode(ctx context.Context, workspaceID, nodeID string, options ...OptionElement) (*models.Node, error)
DeleteNode deletes asynchronously a node. The attachment returned will depend of the option passed. If none is passed the node will be returned once the request accepted, its state will be delete_pending If the option WithWaitUntilElementUndeployed() is passed, the node won't be returned as it would have been deleted. However, if an error is triggered, an object could be returned with a delete_error state. If the option WithWaitUntilElementDeployed() is passed, it will not be considered hence the node returned will be in state delete_pending
func (*Client) DeletePhysicalPort ¶ added in v0.0.14
DeletePhysicalPort creates a physical port in Autonomi platform. As
func (*Client) DeleteTransport ¶ added in v0.0.4
func (c *Client) DeleteTransport(ctx context.Context, workspaceID, transportID string, options ...OptionElement) (*models.Transport, error)
DeleteTransport deletes asynchronously a transport. The transport returned will depend of the option passed. If none is passed the transport will be returned once the request accepted, its state will be delete_pending If the option WithWaitUntilElementUndeployed() is passed, the transport won't be returned as it would have been deleted. However, if an error is triggered, an object could be returned with a delete_error state. If the option WithWaitUntilElementDeployed() is passed, it will not be considered hence the transport returned will be in state delete_pending
func (*Client) DeleteUser ¶ added in v1.3.0
func (*Client) DeleteWorkspace ¶
func (*Client) GetAttachment ¶ added in v0.0.7
func (*Client) GetPhysicalPort ¶ added in v0.0.14
func (*Client) GetTransport ¶ added in v0.0.4
func (*Client) GetWorkspace ¶
func (*Client) ListAccounts ¶ added in v1.2.0
func (*Client) ListPort ¶ added in v0.0.12
func (c *Client) ListPort(options ...OptionElement) (*[]models.PhysicalPort, error)
func (*Client) ListWorkspaces ¶ added in v1.2.0
func (*Client) UpdateNode ¶
func (*Client) UpdateTransport ¶ added in v0.0.4
type Element ¶ added in v0.0.7
type Element interface { *models.Node | *models.Transport | *models.Attachment GetState() models.AdministrativeState }
type OptionClient ¶
type OptionClient func(*Client)
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) OptionClient
WithHTTPClient init http client. If its timeout is above 30s it will be overide to be equal to 30 seconds
func WithHostURL ¶
func WithHostURL(url *url.URL) OptionClient
func WithPersonalAccessToken ¶
func WithPersonalAccessToken(token string) OptionClient
type OptionElement ¶ added in v0.0.6
type OptionElement func(*elementOptions)
func WithAdministrativeState ¶ added in v0.0.6
func WithAdministrativeState(administrativeState models.AdministrativeState) OptionElement
WithAdministrativeState allows setting a specific administrative state.
func WithWaitUntilElementDeployed ¶ added in v0.0.11
func WithWaitUntilElementDeployed() OptionElement
func WithWaitUntilElementUndeployed ¶ added in v0.0.11
func WithWaitUntilElementUndeployed() OptionElement