azure

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AzureBlobStorageURL = ".blob.core.windows.net/"
)
View Source
const E2EInstanceTagKey = "e2e_instance"

Variables

This section is empty.

Functions

func CreateBlobContainer

func CreateBlobContainer(ctx context.Context, rg, saName, subscriptionID, name string) armstorage.BlobContainer

CreateBlobContainer will create a new blob storage container

func CreateBlobStorageAccount

func CreateBlobStorageAccount(ctx context.Context, cli *armstorage.StorageAccountsClient, rgName, region string) armstorage.StorageAccount

CreateBlobStorageAccount creates an Azure storage account in the given resource group and region. Because storage account names are globally unique, this helper generates a random name to reduce the risk of running into naming conflicts.

func CreateDevice

func CreateDevice(hubName, deviceName, iotownerKey string) (string, error)

CreateDevice relies on the REST API to create a new device for testing returning the primary key used for the newly created device.

func CreateEventHubCommon

func CreateEventHubCommon(ctx context.Context, subscriptionID, name, region, rg string, omitHub bool) *eventhubs.Hub

func CreateEventHubComponents

func CreateEventHubComponents(ctx context.Context, subscriptionID, name, region, rg string) *eventhubs.Hub

func CreateEventHubNamespaceOnly

func CreateEventHubNamespaceOnly(ctx context.Context, subscriptionID, name, region, rg string) *eventhubs.Hub

func CreateIOTHubComponents

func CreateIOTHubComponents(ctx context.Context, subscriptionID, rg, region, name string) (string, string)

CreateIOTHubComponents Will create the Azure IOT Hub, and a device to produce data

func CreateNsService

func CreateNsService(ctx context.Context, region string, name string, nsCli *servicebus.NamespacesClient) *sv.Namespace

CreateNsService will create a servicebus namespace service.

func CreateQueueStorage

func CreateQueueStorage(ctx context.Context, name, accountName string, accountKey string) *azqueue.MessagesURL

CreateQueueStorage will create a queue storage message url

func CreateQueueStorageAccount

func CreateQueueStorageAccount(ctx context.Context, cli *armstorage.StorageAccountsClient, name, rgName, region string) armstorage.StorageAccount

CreateQueueStorageAccount provides a wrapper to support Queue storage test

func CreateResourceGroup

func CreateResourceGroup(ctx context.Context, subscriptionID, name, region string) armresources.ResourceGroup

CreateResourceGroup will create the resource group containing all of the eventhub components.

func CreateSaSToken

func CreateSaSToken(uri, name, key string, withName bool) string

CreateSaSToken will create a shared access signature to interact with the Azure IOTEventHub for device management.

func CreateServiceBusNamespace

func CreateServiceBusNamespace(ctx context.Context, cli servicebus.NamespacesClient, rgName string, nsName string, region string) error

func CreateServiceBusNamespaceClient

func CreateServiceBusNamespaceClient(ctx context.Context, subscriptionID, region string) *servicebus.NamespacesClient

CreateServiceBusNamespaceClient will create the servicebus client

func CreateStorageAccountCommon

func CreateStorageAccountCommon(ctx context.Context, cli *armstorage.StorageAccountsClient, name, rgName, region string, isBlob bool) armstorage.StorageAccount

CreateStorageAccountCommon will create an azure storage account for both blob and queue storage tests

func CreateStorageAccountsClient

func CreateStorageAccountsClient(subscriptionID string) *armstorage.StorageAccountsClient

CreateStorageAccountsClient will create the storage account client

func DeleteBlob

func DeleteBlob(ctx context.Context, containerName, saName, name string)

DeleteBlob will delete the blob located at the name location

func DeleteResourceGroup

func DeleteResourceGroup(ctx context.Context, subscriptionID, name string) armresources.ResourceGroupsDeletePollerResponse

DeleteResourceGroup will delete everything under it allowing for easy cleanup

func GetStorageAccountKey

GetStorageAccountKey will return the storage account keys

func ReadSeekCloser

func ReadSeekCloser(r *strings.Reader) readSeekCloser

ReadSeekCloser implements a closer with Seek, Read, and Close

func UploadBlob

func UploadBlob(ctx context.Context, containerName, saName, name, data string)

UploadBlob will upload a new chunk of data to the blob storage

func WaitForFutureDeletion

func WaitForFutureDeletion(ctx context.Context, subscriptionID string, future armresources.ResourceGroupsDeletePollerResponse)

WaitForFutureDeletion will wait on the resource to be deleted before continuing

Types

This section is empty.

Jump to

Keyboard shortcuts

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