jkawamoto/roadie

View on GitHub
cloud/azure/batch/client/compute_nodes/compute_nodes_client.go

Summary

Maintainability
F
5 days
Test Coverage
package compute_nodes

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
    "github.com/go-openapi/runtime"

    strfmt "github.com/go-openapi/strfmt"
)

// New creates a new compute nodes API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
    return &Client{transport: transport, formats: formats}
}

/*
Client for compute nodes API
*/
type Client struct {
    transport runtime.ClientTransport
    formats   strfmt.Registry
}

/*
ComputeNodeAddUser adds a user account to the specified compute node

You can add a user account to a node only when it is in the idle or running state.
*/
func (a *Client) ComputeNodeAddUser(params *ComputeNodeAddUserParams) (*ComputeNodeAddUserCreated, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewComputeNodeAddUserParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "ComputeNode_AddUser",
        Method:             "POST",
        PathPattern:        "/pools/{poolId}/nodes/{nodeId}/users",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ComputeNodeAddUserReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ComputeNodeAddUserCreated), nil

}

/*
ComputeNodeDeleteUser deletes a user account from the specified compute node

You can delete a user account to a node only when it is in the idle or running state.
*/
func (a *Client) ComputeNodeDeleteUser(params *ComputeNodeDeleteUserParams) (*ComputeNodeDeleteUserOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewComputeNodeDeleteUserParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "ComputeNode_DeleteUser",
        Method:             "DELETE",
        PathPattern:        "/pools/{poolId}/nodes/{nodeId}/users/{userName}",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ComputeNodeDeleteUserReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ComputeNodeDeleteUserOK), nil

}

/*
ComputeNodeDisableScheduling disables task scheduling on the specified compute node
*/
func (a *Client) ComputeNodeDisableScheduling(params *ComputeNodeDisableSchedulingParams) (*ComputeNodeDisableSchedulingOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewComputeNodeDisableSchedulingParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "ComputeNode_DisableScheduling",
        Method:             "POST",
        PathPattern:        "/pools/{poolId}/nodes/{nodeId}/disablescheduling",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ComputeNodeDisableSchedulingReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ComputeNodeDisableSchedulingOK), nil

}

/*
ComputeNodeEnableScheduling enables task scheduling on the specified compute node
*/
func (a *Client) ComputeNodeEnableScheduling(params *ComputeNodeEnableSchedulingParams) (*ComputeNodeEnableSchedulingOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewComputeNodeEnableSchedulingParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "ComputeNode_EnableScheduling",
        Method:             "POST",
        PathPattern:        "/pools/{poolId}/nodes/{nodeId}/enablescheduling",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ComputeNodeEnableSchedulingReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ComputeNodeEnableSchedulingOK), nil

}

/*
ComputeNodeGet gets information about the specified compute node
*/
func (a *Client) ComputeNodeGet(params *ComputeNodeGetParams) (*ComputeNodeGetOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewComputeNodeGetParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "ComputeNode_Get",
        Method:             "GET",
        PathPattern:        "/pools/{poolId}/nodes/{nodeId}",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ComputeNodeGetReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ComputeNodeGetOK), nil

}

/*
ComputeNodeGetRemoteDesktop gets the remote desktop protocol file for the specified compute node

Before you can access a node by using the RDP file, you must create a user account on the node. This API can only be invoked on pools created with the cloud service configuration property.
*/
func (a *Client) ComputeNodeGetRemoteDesktop(params *ComputeNodeGetRemoteDesktopParams) (*ComputeNodeGetRemoteDesktopOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewComputeNodeGetRemoteDesktopParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "ComputeNode_GetRemoteDesktop",
        Method:             "GET",
        PathPattern:        "/pools/{poolId}/nodes/{nodeId}/rdp",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ComputeNodeGetRemoteDesktopReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ComputeNodeGetRemoteDesktopOK), nil

}

/*
ComputeNodeGetRemoteLoginSettings gets the settings required for remote login to a compute node

Before you can remotely login to a node using the remote login settings, you must create a user account on the node. This API can be invoked only on pools created with the virtual machine configuration property.
*/
func (a *Client) ComputeNodeGetRemoteLoginSettings(params *ComputeNodeGetRemoteLoginSettingsParams) (*ComputeNodeGetRemoteLoginSettingsOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewComputeNodeGetRemoteLoginSettingsParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "ComputeNode_GetRemoteLoginSettings",
        Method:             "GET",
        PathPattern:        "/pools/{poolId}/nodes/{nodeId}/remoteloginsettings",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ComputeNodeGetRemoteLoginSettingsReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ComputeNodeGetRemoteLoginSettingsOK), nil

}

/*
ComputeNodeList lists the compute nodes in the specified pool
*/
func (a *Client) ComputeNodeList(params *ComputeNodeListParams) (*ComputeNodeListOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewComputeNodeListParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "ComputeNode_List",
        Method:             "GET",
        PathPattern:        "/pools/{poolId}/nodes",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ComputeNodeListReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ComputeNodeListOK), nil

}

/*
ComputeNodeReboot restarts the specified compute node

You can restart a node only if it is in an idle or running state.
*/
func (a *Client) ComputeNodeReboot(params *ComputeNodeRebootParams) (*ComputeNodeRebootAccepted, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewComputeNodeRebootParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "ComputeNode_Reboot",
        Method:             "POST",
        PathPattern:        "/pools/{poolId}/nodes/{nodeId}/reboot",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ComputeNodeRebootReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ComputeNodeRebootAccepted), nil

}

/*
ComputeNodeReimage reinstalls the operating system on the specified compute node

You can reinstall the operating system on a node only if it is in an idle or running state. This API can be invoked only on pools created with the cloud service configuration property.
*/
func (a *Client) ComputeNodeReimage(params *ComputeNodeReimageParams) (*ComputeNodeReimageAccepted, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewComputeNodeReimageParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "ComputeNode_Reimage",
        Method:             "POST",
        PathPattern:        "/pools/{poolId}/nodes/{nodeId}/reimage",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ComputeNodeReimageReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ComputeNodeReimageAccepted), nil

}

/*
ComputeNodeUpdateUser updates the password or expiration time of a user account on the specified compute node

This operation replaces of all the updateable properties of the account. For example, if the expiryTime element is not specified, the current value is replaced with the default value, not left unmodified. You can update a user account on a node only when it is in the idle or running state.
*/
func (a *Client) ComputeNodeUpdateUser(params *ComputeNodeUpdateUserParams) (*ComputeNodeUpdateUserOK, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewComputeNodeUpdateUserParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "ComputeNode_UpdateUser",
        Method:             "PUT",
        PathPattern:        "/pools/{poolId}/nodes/{nodeId}/users/{userName}",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &ComputeNodeUpdateUserReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*ComputeNodeUpdateUserOK), nil

}

/*
PoolRemoveNodes removes compute nodes from the specified pool

This operation can only run when the allocation state of the pool is steady. When this operation runs, the allocation state changes from steady to resizing.
*/
func (a *Client) PoolRemoveNodes(params *PoolRemoveNodesParams) (*PoolRemoveNodesAccepted, error) {
    // TODO: Validate the params before sending
    if params == nil {
        params = NewPoolRemoveNodesParams()
    }

    result, err := a.transport.Submit(&runtime.ClientOperation{
        ID:                 "Pool_RemoveNodes",
        Method:             "POST",
        PathPattern:        "/pools/{poolId}/removenodes",
        ProducesMediaTypes: []string{"application/json"},
        ConsumesMediaTypes: []string{"application/json; odata=minimalmetadata"},
        Schemes:            []string{"https"},
        Params:             params,
        Reader:             &PoolRemoveNodesReader{formats: a.formats},
        Context:            params.Context,
        Client:             params.HTTPClient,
    })
    if err != nil {
        return nil, err
    }
    return result.(*PoolRemoveNodesAccepted), nil

}

// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
    a.transport = transport
}