filesystems

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

README

Data Lake Storage Gen2 File Systems SDK for API version 2023-11-03

This package allows you to interact with the Data Lake Storage Gen2 File Systems API

Supported Authorizers

  • Azure Active Directory (for the Resource Endpoint https://storage.azure.com)

Example Usage

package main

import (
	"context"
	"fmt"
	
    "github.com/hashicorp/go-azure-helpers/authentication"
    "github.com/hashicorp/go-azure-helpers/sender"
	"github.com/hashicorp/go-azure-sdk/sdk/auth"
    "github.com/tombuildsstuff/giovanni/storage/2023-11-03/datalakestore/filesystems"
)

func Example() error {
	accountName := "storageaccount1"
    fileSystemName := "filesystem1"
	storageAccountKey := "ABC123...."
	domainSuffix := "core.windows.net"
	

	auth, err := auth.NewSharedKeyAuthorizer(accountName, storageAccountKey, auth.SharedKey)
	if err != nil {
		return fmt.Errorf("building SharedKey authorizer: %+v", err)
	}
	
    fileSystemsClient, err := filesystems.NewWithBaseUri(fmt.Sprintf("https://%s.dfs.%s", accountName, domainSuffix))
	if err != nil {
		return fmt.Errorf("building client for environment: %+v", err)
	}
	fileSystemsClient.Client.SetAuthorizer(auth)

	input := filesystems.CreateInput{
		Properties: map[string]string{},
	}

	ctx := context.Background()
	if _, err = fileSystemsClient.Create(ctx, fileSystemName, input); err != nil {
		return fmt.Errorf("Error creating: %s", err)
	}
	
    return nil 
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Client *storage.Client
}

Client is the base client for Data Lake Store Filesystems.

func NewWithBaseUri

func NewWithBaseUri(baseUri string) (*Client, error)

func (Client) Create

func (c Client) Create(ctx context.Context, fileSystemName string, input CreateInput) (result CreateResponse, err error)

Create creates a Data Lake Store Gen2 FileSystem within a Storage Account

func (Client) Delete

func (c Client) Delete(ctx context.Context, fileSystemName string) (result DeleteResponse, err error)

Delete deletes a Data Lake Store Gen2 FileSystem within a Storage Account

func (Client) GetProperties

func (c Client) GetProperties(ctx context.Context, fileSystemName string) (result GetPropertiesResponse, err error)

GetProperties gets the properties for a Data Lake Store Gen2 FileSystem within a Storage Account

func (Client) GetResourceManagerResourceID

func (c Client) GetResourceManagerResourceID(subscriptionID, resourceGroup, accountName, fileSystemName string) string

GetResourceManagerResourceID returns the Resource Manager specific ResourceID for a specific Data Lake FileSystem

func (Client) SetProperties

func (c Client) SetProperties(ctx context.Context, fileSystemName string, input SetPropertiesInput) (result SetPropertiesResponse, err error)

SetProperties sets the Properties for a Data Lake Store Gen2 FileSystem within a Storage Account

type CreateInput

type CreateInput struct {
	// The encryption scope to set as the default on the filesystem.
	DefaultEncryptionScope string

	// A map of base64-encoded strings to store as user-defined properties with the File System
	// Note that items may only contain ASCII characters in the ISO-8859-1 character set.
	// This automatically gets converted to a comma-separated list of name and
	// value pairs before sending to the API
	Properties map[string]string
}

type CreateResponse

type CreateResponse struct {
	HttpResponse *http.Response
}

type DeleteResponse

type DeleteResponse struct {
	HttpResponse *http.Response
}

type FileSystemId added in v0.22.0

type FileSystemId struct {
	// AccountId specifies the ID of the Storage Account where this Data Lake FileSystem exists.
	AccountId accounts.AccountId

	// FileSystemName specifies the name of this Data Lake FileSystem.
	FileSystemName string
}

func NewFileSystemID added in v0.22.0

func NewFileSystemID(accountId accounts.AccountId, fileSystemName string) FileSystemId

func ParseFileSystemID added in v0.22.0

func ParseFileSystemID(input, domainSuffix string) (*FileSystemId, error)

ParseFileSystemID parses `input` into a File System ID using a known `domainSuffix`

func (FileSystemId) ID added in v0.22.0

func (b FileSystemId) ID() string

func (FileSystemId) String added in v0.22.0

func (b FileSystemId) String() string

type GetPropertiesResponse

type GetPropertiesResponse struct {
	HttpResponse *http.Response

	// The default encryption scope for the filesystem.
	DefaultEncryptionScope string

	// A map of base64-encoded strings to store as user-defined properties with the File System
	// Note that items may only contain ASCII characters in the ISO-8859-1 character set.
	// This automatically gets converted to a comma-separated list of name and
	// value pairs before sending to the API
	Properties map[string]string

	// Is Hierarchical Namespace Enabled?
	NamespaceEnabled bool
}

type SetPropertiesInput

type SetPropertiesInput struct {
	// A map of base64-encoded strings to store as user-defined properties with the File System
	// Note that items may only contain ASCII characters in the ISO-8859-1 character set.
	// This automatically gets converted to a comma-separated list of name and
	// value pairs before sending to the API
	Properties map[string]string

	// Optional - A date and time value.
	// Specify this header to perform the operation only if the resource has been modified since the specified date and time.
	IfModifiedSince *string

	// Optional - A date and time value.
	// Specify this header to perform the operation only if the resource has not been modified since the specified date and time.
	IfUnmodifiedSince *string
}

type SetPropertiesResponse

type SetPropertiesResponse struct {
	HttpResponse *http.Response
}

Jump to

Keyboard shortcuts

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