Skip to content

Latest commit

 

History

History
423 lines (294 loc) · 22.3 KB

VirtualMachinesAPI.md

File metadata and controls

423 lines (294 loc) · 22.3 KB

\VirtualMachinesAPI

All URIs are relative to http://localhost

Method HTTP request Description
VirtualMachineSnapshotsGet Get /api/2.56/virtual-machine-snapshots List Virtual Machine Snapshots
VirtualMachineVolumeSnapshotsGet Get /api/2.56/virtual-machine-volume-snapshots List Virtual Machine Volume Snapshots
VirtualMachinesGet Get /api/2.56/virtual-machines List Virtual Machines
VirtualMachinesPatch Patch /api/2.56/virtual-machines Update a virtual machine
VirtualMachinesPost Post /api/2.56/virtual-machines Create a virtual machine

VirtualMachineSnapshotsGet

VirtualMachineGetResponse VirtualMachineSnapshotsGet(ctx).Authorization(authorization).XRequestID(xRequestID).ContinuationToken(continuationToken).Destroyed(destroyed).Filter(filter).Limit(limit).Offset(offset).Sort(sort).TotalItemCount(totalItemCount).VmIds(vmIds).VmType(vmType).Execute()

List Virtual Machine Snapshots

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/PureStorage-OpenConnect/go-pure-client/flasharray/FA_2_56"
)

func main() {
    configuration, err := openapiclient.NewConfigurationBuilder(server.URL).
        APIToken(apiToken).
        Build()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when creating api client configuration: %v\n", err)
    }
    apiClient, err := openapiclient.NewClient(configuration)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when creating api client: %v\n", err)
    }
    req := apiClient.VirtualMachinesAPI.VirtualMachineSnapshotsGet(context.Background())
    // Set request parameters ...

    resp, r, err := req.Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VirtualMachinesAPI.VirtualMachineSnapshotsGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `VirtualMachineSnapshotsGet`: VirtualMachineGetResponse
    fmt.Fprintf(os.Stdout, "Response from `VirtualMachinesAPI.VirtualMachineSnapshotsGet`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiVirtualMachineSnapshotsGetRequest struct via the builder pattern

Name Type Description Notes
authorization string Access token (in JWT format) required to use any API endpoint (except `/oauth2`, `/login`, and `/logout`)
xRequestID string Supplied by client during request or generated by server.
continuationToken string A token used to retrieve the next page of data with some consistency guaranteed. The token is a Base64 encoded value. Set `continuation_token` to the system-generated token taken from the `x-next-token` header field of the response. A query has reached its last page when the response does not include a token. Pagination requires the `limit` and `continuation_token` query parameters.
destroyed bool If set to `true`, lists only destroyed objects that are in the eradication pending state. If set to `false`, lists only objects that are not destroyed. If not set, lists both objects that are destroyed and those that are not destroyed. For destroyed objects, the time remaining is displayed in milliseconds. If object name(s) or id(s) are specified, then each object referenced must exist. If `destroyed` is set to `true`, then each object referenced must also be destroyed. If `destroyed` is set to `false`, then each object referenced must also not be destroyed. An error is returned if any of these conditions are not met.
filter string Narrows down the results to only the response objects that satisfy the filter criteria.
limit int32 Limits the size of the response to the specified number of objects on each page. To return the total number of resources, set `limit=0`. The total number of resources is returned as a `total_item_count` value. If the page size requested is larger than the system maximum limit, the server returns the maximum limit, disregarding the requested page size.
offset int32 The starting position based on the results of the query in relation to the full set of response objects returned.
sort []string Sorts the response objects by the specified fields. Sorting can be applied to any field name in the response, in ascending order by default, or in descending order by prefixing the field name with a minus sign (-). Multiple fields can be specified as a comma-separated list (e.g., sort volumes by size descending, then by name ascending). If sort is provided, the response will not include a continuation_token.
totalItemCount bool If set to `true`, the `total_item_count` matching the specified query parameters is calculated and returned in the response. If set to `false`, the `total_item_count` is `null` in the response. This may speed up queries where the `total_item_count` is large. If not specified, defaults to `false`.
vmIds []string Performs the operation on the unique virtual machine IDs specified. Enter multiple resource IDs in a comma-separated format.
vmType string The type of virtual machine. The only valid value is `vvol`.

Return type

VirtualMachineGetResponse

Authorization

Authorization is handled by the Authenticator specified in the configuration and data are filled automatically. Use param authorization only when you need to override this behaviour.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

VirtualMachineVolumeSnapshotsGet

VirtualMachineVolumeSnapshotResponse VirtualMachineVolumeSnapshotsGet(ctx).VmIds(vmIds).Authorization(authorization).XRequestID(xRequestID).ContinuationToken(continuationToken).Destroyed(destroyed).Filter(filter).Limit(limit).Offset(offset).Sort(sort).TotalItemCount(totalItemCount).VmType(vmType).Execute()

List Virtual Machine Volume Snapshots

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/PureStorage-OpenConnect/go-pure-client/flasharray/FA_2_56"
)

func main() {
    configuration, err := openapiclient.NewConfigurationBuilder(server.URL).
        APIToken(apiToken).
        Build()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when creating api client configuration: %v\n", err)
    }
    apiClient, err := openapiclient.NewClient(configuration)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when creating api client: %v\n", err)
    }
    req := apiClient.VirtualMachinesAPI.VirtualMachineVolumeSnapshotsGet(context.Background())
    // Set request parameters ...

    resp, r, err := req.Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VirtualMachinesAPI.VirtualMachineVolumeSnapshotsGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `VirtualMachineVolumeSnapshotsGet`: VirtualMachineVolumeSnapshotResponse
    fmt.Fprintf(os.Stdout, "Response from `VirtualMachinesAPI.VirtualMachineVolumeSnapshotsGet`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiVirtualMachineVolumeSnapshotsGetRequest struct via the builder pattern

Name Type Description Notes
vmIds []string Performs the operation on the unique virtual machine IDs specified. Enter multiple resource IDs in a comma-separated format.
authorization string Access token (in JWT format) required to use any API endpoint (except `/oauth2`, `/login`, and `/logout`)
xRequestID string Supplied by client during request or generated by server.
continuationToken string A token used to retrieve the next page of data with some consistency guaranteed. The token is a Base64 encoded value. Set `continuation_token` to the system-generated token taken from the `x-next-token` header field of the response. A query has reached its last page when the response does not include a token. Pagination requires the `limit` and `continuation_token` query parameters.
destroyed bool If set to `true`, lists only destroyed objects that are in the eradication pending state. If set to `false`, lists only objects that are not destroyed. If not set, lists both objects that are destroyed and those that are not destroyed. For destroyed objects, the time remaining is displayed in milliseconds. If object name(s) or id(s) are specified, then each object referenced must exist. If `destroyed` is set to `true`, then each object referenced must also be destroyed. If `destroyed` is set to `false`, then each object referenced must also not be destroyed. An error is returned if any of these conditions are not met.
filter string Narrows down the results to only the response objects that satisfy the filter criteria.
limit int32 Limits the size of the response to the specified number of objects on each page. To return the total number of resources, set `limit=0`. The total number of resources is returned as a `total_item_count` value. If the page size requested is larger than the system maximum limit, the server returns the maximum limit, disregarding the requested page size.
offset int32 The starting position based on the results of the query in relation to the full set of response objects returned.
sort []string Sorts the response objects by the specified fields. Sorting can be applied to any field name in the response, in ascending order by default, or in descending order by prefixing the field name with a minus sign (-). Multiple fields can be specified as a comma-separated list (e.g., sort volumes by size descending, then by name ascending). If sort is provided, the response will not include a continuation_token.
totalItemCount bool If set to `true`, the `total_item_count` matching the specified query parameters is calculated and returned in the response. If set to `false`, the `total_item_count` is `null` in the response. This may speed up queries where the `total_item_count` is large. If not specified, defaults to `false`.
vmType string The type of virtual machine. The only valid value is `vvol`.

Return type

VirtualMachineVolumeSnapshotResponse

Authorization

Authorization is handled by the Authenticator specified in the configuration and data are filled automatically. Use param authorization only when you need to override this behaviour.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

VirtualMachinesGet

VirtualMachineGetResponse VirtualMachinesGet(ctx).Authorization(authorization).XRequestID(xRequestID).ContinuationToken(continuationToken).Destroyed(destroyed).Filter(filter).Limit(limit).Offset(offset).Sort(sort).TotalItemCount(totalItemCount).VmIds(vmIds).VmType(vmType).Execute()

List Virtual Machines

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/PureStorage-OpenConnect/go-pure-client/flasharray/FA_2_56"
)

func main() {
    configuration, err := openapiclient.NewConfigurationBuilder(server.URL).
        APIToken(apiToken).
        Build()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when creating api client configuration: %v\n", err)
    }
    apiClient, err := openapiclient.NewClient(configuration)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when creating api client: %v\n", err)
    }
    req := apiClient.VirtualMachinesAPI.VirtualMachinesGet(context.Background())
    // Set request parameters ...

    resp, r, err := req.Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VirtualMachinesAPI.VirtualMachinesGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `VirtualMachinesGet`: VirtualMachineGetResponse
    fmt.Fprintf(os.Stdout, "Response from `VirtualMachinesAPI.VirtualMachinesGet`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiVirtualMachinesGetRequest struct via the builder pattern

Name Type Description Notes
authorization string Access token (in JWT format) required to use any API endpoint (except `/oauth2`, `/login`, and `/logout`)
xRequestID string Supplied by client during request or generated by server.
continuationToken string A token used to retrieve the next page of data with some consistency guaranteed. The token is a Base64 encoded value. Set `continuation_token` to the system-generated token taken from the `x-next-token` header field of the response. A query has reached its last page when the response does not include a token. Pagination requires the `limit` and `continuation_token` query parameters.
destroyed bool If set to `true`, lists only destroyed objects that are in the eradication pending state. If set to `false`, lists only objects that are not destroyed. If not set, lists both objects that are destroyed and those that are not destroyed. For destroyed objects, the time remaining is displayed in milliseconds. If object name(s) or id(s) are specified, then each object referenced must exist. If `destroyed` is set to `true`, then each object referenced must also be destroyed. If `destroyed` is set to `false`, then each object referenced must also not be destroyed. An error is returned if any of these conditions are not met.
filter string Narrows down the results to only the response objects that satisfy the filter criteria.
limit int32 Limits the size of the response to the specified number of objects on each page. To return the total number of resources, set `limit=0`. The total number of resources is returned as a `total_item_count` value. If the page size requested is larger than the system maximum limit, the server returns the maximum limit, disregarding the requested page size.
offset int32 The starting position based on the results of the query in relation to the full set of response objects returned.
sort []string Sorts the response objects by the specified fields. Sorting can be applied to any field name in the response, in ascending order by default, or in descending order by prefixing the field name with a minus sign (-). Multiple fields can be specified as a comma-separated list (e.g., sort volumes by size descending, then by name ascending). If sort is provided, the response will not include a continuation_token.
totalItemCount bool If set to `true`, the `total_item_count` matching the specified query parameters is calculated and returned in the response. If set to `false`, the `total_item_count` is `null` in the response. This may speed up queries where the `total_item_count` is large. If not specified, defaults to `false`.
vmIds []string Performs the operation on the unique virtual machine IDs specified. Enter multiple virtual machine IDs in a comma-separated format.
vmType string The type of virtual machine. The only valid value is `vvol`.

Return type

VirtualMachineGetResponse

Authorization

Authorization is handled by the Authenticator specified in the configuration and data are filled automatically. Use param authorization only when you need to override this behaviour.

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

VirtualMachinesPatch

VirtualMachineResponse VirtualMachinesPatch(ctx).VirtualMachine(virtualMachine).Authorization(authorization).XRequestID(xRequestID).Execute()

Update a virtual machine

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/PureStorage-OpenConnect/go-pure-client/flasharray/FA_2_56"
)

func main() {
    configuration, err := openapiclient.NewConfigurationBuilder(server.URL).
        APIToken(apiToken).
        Build()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when creating api client configuration: %v\n", err)
    }
    apiClient, err := openapiclient.NewClient(configuration)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when creating api client: %v\n", err)
    }
    req := apiClient.VirtualMachinesAPI.VirtualMachinesPatch(context.Background())
    // Set request parameters ...

    resp, r, err := req.Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VirtualMachinesAPI.VirtualMachinesPatch``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `VirtualMachinesPatch`: VirtualMachineResponse
    fmt.Fprintf(os.Stdout, "Response from `VirtualMachinesAPI.VirtualMachinesPatch`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiVirtualMachinesPatchRequest struct via the builder pattern

Name Type Description Notes
virtualMachine VirtualMachinePost
authorization string Access token (in JWT format) required to use any API endpoint (except `/oauth2`, `/login`, and `/logout`)
xRequestID string Supplied by client during request or generated by server.

Return type

VirtualMachineResponse

Authorization

Authorization is handled by the Authenticator specified in the configuration and data are filled automatically. Use param authorization only when you need to override this behaviour.

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

VirtualMachinesPost

VirtualMachineResponse VirtualMachinesPost(ctx).VirtualMachine(virtualMachine).Authorization(authorization).XRequestID(xRequestID).Overwrite(overwrite).Execute()

Create a virtual machine

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/PureStorage-OpenConnect/go-pure-client/flasharray/FA_2_56"
)

func main() {
    configuration, err := openapiclient.NewConfigurationBuilder(server.URL).
        APIToken(apiToken).
        Build()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when creating api client configuration: %v\n", err)
    }
    apiClient, err := openapiclient.NewClient(configuration)
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when creating api client: %v\n", err)
    }
    req := apiClient.VirtualMachinesAPI.VirtualMachinesPost(context.Background())
    // Set request parameters ...

    resp, r, err := req.Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `VirtualMachinesAPI.VirtualMachinesPost``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `VirtualMachinesPost`: VirtualMachineResponse
    fmt.Fprintf(os.Stdout, "Response from `VirtualMachinesAPI.VirtualMachinesPost`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiVirtualMachinesPostRequest struct via the builder pattern

Name Type Description Notes
virtualMachine VirtualMachinePost
authorization string Access token (in JWT format) required to use any API endpoint (except `/oauth2`, `/login`, and `/logout`)
xRequestID string Supplied by client during request or generated by server.
overwrite bool If set to `true`, overwrites an existing object during an object copy operation. If set to `false` or not set at all and the target name is an existing object, the copy operation fails. Required if the `source` body parameter is set and the source overwrites an existing object during the copy operation.

Return type

VirtualMachineResponse

Authorization

Authorization is handled by the Authenticator specified in the configuration and data are filled automatically. Use param authorization only when you need to override this behaviour.

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]