Documentation ¶
Overview ¶
Copyright (C) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE-CODE in the project root for license information. Package azure implements various azure tools
Copyright (C) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE-CODE in the project root for license information.
Copyright (C) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE-CODE in the project root for license information.
Copyright (C) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE-CODE in the project root for license information. Package azure implements various azure tools
Copyright (C) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE-CODE in the project root for license information.
Copyright (C) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE-CODE in the project root for license information.
Copyright (C) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE-CODE in the project root for license information. Package azure implements various azure tools
Copyright (C) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE-CODE in the project root for license information. Package azure implements various azure tools
Copyright (C) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE-CODE in the project root for license information. Package azure implements various azure tools
Index ¶
- Constants
- func AnthonyBernieDefaultHTTPClientFactory() pipeline.Factory
- func FatalValidateContainerName(containerName string)
- func FatalValidateQueueName(queueName string)
- func GetSubnetId(subscriptionId string, resourceGroupName string, vnetName string, ...) string
- func GetUsageAttribution(ctx context.Context) (string, bool)
- func SetUsageAttribution(ctx context.Context, usageGuid string) context.Context
- func ValidateContainerName(containerName string) (bool, string)
- func ValidateQueueName(queueName string) (bool, string)
- type BlobContainer
- type EventHubSender
- type Queue
- func (q *Queue) DeleteMessage(messageID azqueue.MessageID, popReceipt azqueue.PopReceipt) (*azqueue.MessageIDDeleteResponse, error)
- func (q *Queue) Dequeue(maxMessages int32, visibilityTimeout time.Duration) (*azqueue.DequeuedMessagesResponse, error)
- func (q *Queue) Enqueue(message string) error
- func (q *Queue) IsQueueEmpty() (bool, error)
- func (q *Queue) Peek(maxMessages int32) (*azqueue.PeekedMessagesResponse, error)
- func (q *Queue) UpdateVisibilityTimeout(messageID azqueue.MessageID, popReceipt azqueue.PopReceipt, ...) (*azqueue.UpdatedMessageResponse, error)
- type ResourceGroup
- type Vmss
- func (v *Vmss) Create(resourceGroupName string, vmss compute.VirtualMachineScaleSet) (compute.VirtualMachineScaleSetsCreateOrUpdateFuture, error)
- func (v *Vmss) ListVMSS(resourceGroupName string) ([]compute.VirtualMachineScaleSet, error)
- func (v *Vmss) Update(resourceGroupName string, vmss compute.VirtualMachineScaleSet) (compute.VirtualMachineScaleSetsCreateOrUpdateFuture, error)
- type VmssOperation
- type VmssOperationManager
Constants ¶
const ( AZURE_TENANT_ID = "AZURE_TENANT_ID" AZURE_CLIENT_ID = "AZURE_CLIENT_ID" AZURE_CLIENT_SECRET = "AZURE_CLIENT_SECRET" AZURE_SUBSCRIPTION_ID = "AZURE_SUBSCRIPTION_ID" AZURE_STORAGE_ACCOUNT = "AZURE_STORAGE_ACCOUNT" AZURE_STORAGE_ACCOUNT_KEY = "AZURE_STORAGE_ACCOUNT_KEY" AZURE_EVENTHUB_SENDERKEYNAME = "AZURE_EVENTHUB_SENDERKEYNAME" AZURE_EVENTHUB_SENDERKEY = "AZURE_EVENTHUB_SENDERKEY" AZURE_EVENTHUB_NAMESPACENAME = "AZURE_EVENTHUB_NAMESPACENAME" DEFAULT_OPERATION_POLL_TIME = time.Duration(10) * time.Second MAX_OPERATION_POLL_TIME = time.Duration(60) * time.Second )
const AVERE_USAGE_GUID = "7a86fa6c-a5c7-4f21-b9fa-efa3dcbfbb86"
const (
PrintStatsCycle = time.Duration(30) * time.Second // 30 seconds
)
Variables ¶
This section is empty.
Functions ¶
func AnthonyBernieDefaultHTTPClientFactory ¶
AnthonyBernieDefaultHTTPClientFactory creates a DefaultHTTPClientPolicyFactory object that sends HTTP requests to a Go's default http.Client.
func FatalValidateContainerName ¶
func FatalValidateContainerName(containerName string)
FatalValidateContainerName exits the program if the containername is not valid
func FatalValidateQueueName ¶
func FatalValidateQueueName(queueName string)
FatalValidateQueue exits the program if the queuename is not valid
func GetSubnetId ¶
func GetUsageAttribution ¶
get usage attribution from the context - https://docs.microsoft.com/en-us/azure/marketplace/azure-partner-customer-usage-attribution
func SetUsageAttribution ¶
set usage attribution on the context - https://docs.microsoft.com/en-us/azure/marketplace/azure-partner-customer-usage-attribution
func ValidateContainerName ¶
ValidateContainerName validates container name according to https://docs.microsoft.com/en-us/rest/api/storageservices/create-container
func ValidateQueueName ¶
ValidateQueue validates queue name according to https://docs.microsoft.com/en-us/rest/api/storageservices/naming-queues-and-metadata
Types ¶
type BlobContainer ¶
type BlobContainer struct { ContainerURL azblob.ContainerURL Context context.Context }
BlobContainer represents a blob container, this can be used to read/write blockblobs, appendblobs, or page blobs The implementation has been influenced by https://github.com/Azure/azure-storage-blob-go/blob/master/azblob/zt_examples_test.go RESTAPI: https://docs.microsoft.com/en-us/rest/api/storageservices/blob-service-rest-api AZBLOB: https://godoc.org/github.com/Azure/azure-storage-blob-go/azblob#pkg-examples
func InitializeBlobContainer ¶
func InitializeBlobContainer(ctx context.Context, storageAccount string, storageAccountKey string, containerName string) (*BlobContainer, error)
InitializeBlob creates a Blob to represent the Azure Storage Queue
func (*BlobContainer) DeleteBlob ¶
func (b *BlobContainer) DeleteBlob(blobname string) error
DeleteBlob deletes the blob
func (*BlobContainer) DownloadBlob ¶
func (b *BlobContainer) DownloadBlob(blobname string) ([]byte, error)
DownloadBlob downloads the bytes of the blob
func (*BlobContainer) UploadBlob ¶
func (b *BlobContainer) UploadBlob(blobname string, data []byte) error
UploadBlob uploads the blob to the container
type EventHubSender ¶
type EventHubSender struct {
// contains filtered or unexported fields
}
EventHubSender sends messages to Azure Event Hub
func InitializeEventHubSender ¶
func InitializeEventHubSender( ctx context.Context, senderKeyName string, senderKey string, eventHubNamespaceName string, eventHubName string) (*EventHubSender, error)
InitializeEventHubSender initializes an event hub sender
func (*EventHubSender) IsSenderComplete ¶
func (e *EventHubSender) IsSenderComplete() bool
func (*EventHubSender) RecordTiming ¶
func (e *EventHubSender) RecordTiming(bytes []byte)
RecordTiming implements interface Profiler
type Queue ¶
type Queue struct { QueueURL azqueue.QueueURL MessagesURL azqueue.MessagesURL Context context.Context }
Queue represents a single azure storage queue The implementation has been influenced by https://github.com/Azure/azure-storage-queue-go/blob/master/azqueue/zt_examples_test.go
func InitializeQueue ¶
func InitializeQueue(ctx context.Context, storageAccount string, storageAccountKey string, queueName string) *Queue
InitializeQueue creates a Queue to represent the Azure Storage Queue, panic if error
func InitializeQueueNonFatal ¶
func InitializeQueueNonFatal(ctx context.Context, storageAccount string, storageAccountKey string, queueName string) (*Queue, error)
InitializeQueueNonFatal creates a Queue to represent the Azure Storage Queue
func (*Queue) DeleteMessage ¶
func (q *Queue) DeleteMessage(messageID azqueue.MessageID, popReceipt azqueue.PopReceipt) (*azqueue.MessageIDDeleteResponse, error)
DeleteMessage deletes the message from the queue
func (*Queue) Dequeue ¶
func (q *Queue) Dequeue(maxMessages int32, visibilityTimeout time.Duration) (*azqueue.DequeuedMessagesResponse, error)
Dequeue marks the item in the storage invisible, but the message will re-appear until deleted
func (*Queue) IsQueueEmpty ¶
func (*Queue) Peek ¶
func (q *Queue) Peek(maxMessages int32) (*azqueue.PeekedMessagesResponse, error)
func (*Queue) UpdateVisibilityTimeout ¶
type ResourceGroup ¶
type ResourceGroup struct { GroupsClient resources.GroupsClient Context context.Context }
func InitializeResourceGroup ¶
func InitializeResourceGroup(ctx context.Context, authorizer autorest.Authorizer, subscriptionId string) *ResourceGroup
func (*ResourceGroup) GetResourceGroupIntTag ¶
func (rg *ResourceGroup) GetResourceGroupIntTag(resourceGroupName string, tagName string) (int, error)
func (*ResourceGroup) SetTotalNodesIntTag ¶
type Vmss ¶
type Vmss struct { VmssClient compute.VirtualMachineScaleSetsClient Context context.Context }
func InitializeVmss ¶
func (*Vmss) Create ¶
func (v *Vmss) Create(resourceGroupName string, vmss compute.VirtualMachineScaleSet) (compute.VirtualMachineScaleSetsCreateOrUpdateFuture, error)
func (*Vmss) ListVMSS ¶
func (v *Vmss) ListVMSS(resourceGroupName string) ([]compute.VirtualMachineScaleSet, error)
func (*Vmss) Update ¶
func (v *Vmss) Update(resourceGroupName string, vmss compute.VirtualMachineScaleSet) (compute.VirtualMachineScaleSetsCreateOrUpdateFuture, error)
type VmssOperation ¶
type VmssOperationManager ¶
type VmssOperationManager struct { Context context.Context Client autorest.Client // contains filtered or unexported fields }
func InitializeVmssOperationManager ¶
func InitializeVmssOperationManager(ctx context.Context, client autorest.Client) *VmssOperationManager
func (*VmssOperationManager) AddWatchOperation ¶
func (v *VmssOperationManager) AddWatchOperation(vmssName string, futureAPI azure.FutureAPI)
func (*VmssOperationManager) IsComplete ¶
func (v *VmssOperationManager) IsComplete(vmssName string) bool
func (*VmssOperationManager) Run ¶
func (v *VmssOperationManager) Run(syncWaitGroup *sync.WaitGroup)