Skip to content

Latest commit

 

History

History
88 lines (59 loc) · 3.44 KB

File metadata and controls

88 lines (59 loc) · 3.44 KB

\FilesAPI

All URIs are relative to http://localhost

Method HTTP request Description
FilesPost Post /api/2.29/files Create a file copy

FilesPost

FilesPost(ctx).SourceFile(sourceFile).Authorization(authorization).XRequestID(xRequestID).DirectoryIds(directoryIds).DirectoryNames(directoryNames).Overwrite(overwrite).Paths(paths).Execute()

Create a file copy

Example

package main

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

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.FilesAPI.FilesPost(context.Background())
    // Set request parameters ...

    resp, r, err := req.Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FilesAPI.FilesPost``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Other Parameters

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

Name Type Description Notes
sourceFile FilePost
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.
directoryIds []string Performs the operation on the unique managed directory IDs specified. Enter multiple managed directory IDs in comma-separated format. The `directory_ids` or `directory_names` parameter is required, but they cannot be set together.
directoryNames []string Performs the operation on the managed directory names specified. Enter multiple full managed directory names in comma-separated format. For example, `fs:dir01,fs:dir02`.
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.
paths []string Target file path relative to the target directory. Enter multiple target file path in a comma-separated format. For example, `/dir1/dir2/file1,/dir3/dir4/file2`.

Return type

(empty response body)

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: Not defined

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