azure-sdk-for-go

module
v3.1.0-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2016 License: Apache-2.0

README

Microsoft Azure SDK for Go

This project provides various Go packages to perform operations on Microsoft Azure REST APIs.

GoDoc Build Status

See list of implemented API clients here.

NOTE: This repository is under heavy ongoing development and is likely to break over time. We currently do not have any releases yet. If you are planning to use the repository, please consider vendoring the packages in your project and update them when a stable tag is out.

Installation

go get -d github.com/Azure/azure-sdk-for-go/management

Usage

Read Godoc of the repository at: http://godoc.org/github.com/Azure/azure-sdk-for-go/

The client currently supports authentication to the Service Management API with certificates or Azure .publishSettings file. You can download the .publishSettings file for your subscriptions here.

Example: Creating a Linux Virtual Machine
package main

import (
	"encoding/base64"
	"fmt"

	"github.com/Azure/azure-sdk-for-go/management"
	"github.com/Azure/azure-sdk-for-go/management/hostedservice"
	"github.com/Azure/azure-sdk-for-go/management/virtualmachine"
	"github.com/Azure/azure-sdk-for-go/management/vmutils"
)

func main() {
	dnsName := "test-vm-from-go"
	storageAccount := "mystorageaccount"
	location := "West US"
	vmSize := "Small"
	vmImage := "b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140724-en-us-30GB"
	userName := "testuser"
	userPassword := "Test123"

	client, err := management.ClientFromPublishSettingsFile("path/to/downloaded.publishsettings", "")
	if err != nil {
		panic(err)
	}

	// create hosted service
	if err := hostedservice.NewClient(client).CreateHostedService(hostedservice.CreateHostedServiceParameters{
		ServiceName: dnsName,
		Location:    location,
		Label:       base64.StdEncoding.EncodeToString([]byte(dnsName))}); err != nil {
		panic(err)
	}

	// create virtual machine
	role := vmutils.NewVMConfiguration(dnsName, vmSize)
	vmutils.ConfigureDeploymentFromPlatformImage(
		&role,
		vmImage,
		fmt.Sprintf("http://%s.blob.core.windows.net/sdktest/%s.vhd", storageAccount, dnsName),
		"")
	vmutils.ConfigureForLinux(&role, dnsName, userName, userPassword)
	vmutils.ConfigureWithPublicSSH(&role)

	operationID, err := virtualmachine.NewClient(client).
		CreateDeployment(role, dnsName, virtualmachine.CreateDeploymentOptions{})
	if err != nil {
		panic(err)
	}
	if err := client.WaitForOperation(operationID, nil); err != nil {
		panic(err)
	}
}

License

This project is published under Apache 2.0 License.


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Directories

Path Synopsis
arm
authorization
Package authorization implements the Azure ARM Authorization service API version 2015-07-01.
Package authorization implements the Azure ARM Authorization service API version 2015-07-01.
batch
Package batch implements the Azure ARM Batch service API version 2015-12-01.
Package batch implements the Azure ARM Batch service API version 2015-12-01.
cdn
Package cdn implements the Azure ARM Cdn service API version 2016-04-02.
Package cdn implements the Azure ARM Cdn service API version 2016-04-02.
cognitiveservices
Package cognitiveservices implements the Azure ARM Cognitiveservices service API version 2016-02-01-preview.
Package cognitiveservices implements the Azure ARM Cognitiveservices service API version 2016-02-01-preview.
compute
Package compute implements the Azure ARM Compute service API version 2016-03-30.
Package compute implements the Azure ARM Compute service API version 2016-03-30.
compute/containerservice
Package compute implements the Azure ARM Compute service API version 2016-03-30.
Package compute implements the Azure ARM Compute service API version 2016-03-30.
devtestlabs
Package devtestlabs implements the Azure ARM Devtestlabs service API version 2016-05-15.
Package devtestlabs implements the Azure ARM Devtestlabs service API version 2016-05-15.
dns
Package dns implements the Azure ARM Dns service API version 2016-04-01.
Package dns implements the Azure ARM Dns service API version 2016-04-01.
intune
Package intune implements the Azure ARM Intune service API version 2015-01-14-preview.
Package intune implements the Azure ARM Intune service API version 2015-01-14-preview.
logic
Package logic implements the Azure ARM Logic service API version 2015-08-01-preview.
Package logic implements the Azure ARM Logic service API version 2015-08-01-preview.
machinelearning
Package machinelearning implements the Azure ARM Machinelearning service API version 2016-05-01-preview.
Package machinelearning implements the Azure ARM Machinelearning service API version 2016-05-01-preview.
mobileengagement
Package mobileengagement implements the Azure ARM Mobileengagement service API version 2014-12-01.
Package mobileengagement implements the Azure ARM Mobileengagement service API version 2014-12-01.
network
Package network implements the Azure ARM Network service API version 2016-03-30.
Package network implements the Azure ARM Network service API version 2016-03-30.
notificationhubs
Package notificationhubs implements the Azure ARM Notificationhubs service API version 2014-09-01.
Package notificationhubs implements the Azure ARM Notificationhubs service API version 2014-09-01.
powerbiembedded
Package powerbiembedded implements the Azure ARM Powerbiembedded service API version 2016-01-29.
Package powerbiembedded implements the Azure ARM Powerbiembedded service API version 2016-01-29.
redis
Package redis implements the Azure ARM Redis service API version 2016-04-01.
Package redis implements the Azure ARM Redis service API version 2016-04-01.
resources/features
Package features implements the Azure ARM Features service API version 2015-12-01.
Package features implements the Azure ARM Features service API version 2015-12-01.
resources/locks
Package locks implements the Azure ARM Locks service API version 2015-01-01.
Package locks implements the Azure ARM Locks service API version 2015-01-01.
resources/policy
Package policy implements the Azure ARM Policy service API version 2015-10-01-preview.
Package policy implements the Azure ARM Policy service API version 2015-10-01-preview.
resources/resources
Package resources implements the Azure ARM Resources service API version 2016-02-01.
Package resources implements the Azure ARM Resources service API version 2016-02-01.
resources/subscriptions
Package subscriptions implements the Azure ARM Subscriptions service API version 2015-11-01.
Package subscriptions implements the Azure ARM Subscriptions service API version 2015-11-01.
scheduler
Package scheduler implements the Azure ARM Scheduler service API version 2016-03-01.
Package scheduler implements the Azure ARM Scheduler service API version 2016-03-01.
search
Package search implements the Azure ARM Search service API version 2015-02-28.
Package search implements the Azure ARM Search service API version 2015-02-28.
servicebus
Package servicebus implements the Azure ARM Servicebus service API version 2014-09-01.
Package servicebus implements the Azure ARM Servicebus service API version 2014-09-01.
sql
Package sql implements the Azure ARM Sql service API version 2015-05-01-preview.
Package sql implements the Azure ARM Sql service API version 2015-05-01-preview.
storage
Package storage implements the Azure ARM Storage service API version 2016-01-01.
Package storage implements the Azure ARM Storage service API version 2016-01-01.
trafficmanager
Package trafficmanager implements the Azure ARM Trafficmanager service API version 2015-11-01.
Package trafficmanager implements the Azure ARM Trafficmanager service API version 2015-11-01.
web
Package web implements the Azure ARM Web service API version 2015-08-01.
Package web implements the Azure ARM Web service API version 2015-08-01.
core
http
Package http provides HTTP client and server implementations.
Package http provides HTTP client and server implementations.
tls
Package tls partially implements TLS 1.2, as specified in RFC 5246.
Package tls partially implements TLS 1.2, as specified in RFC 5246.
eng
tools/apidiff Module
tools/indexer Module
tools/pkgchk Module
Package management provides the main API client to construct other clients and make requests to the Microsoft Azure Service Management REST API.
Package management provides the main API client to construct other clients and make requests to the Microsoft Azure Service Management REST API.
hostedservice
Package hostedservice provides a client for Hosted Services.
Package hostedservice provides a client for Hosted Services.
location
Package location provides a client for Locations.
Package location provides a client for Locations.
networksecuritygroup
Package networksecuritygroup provides a client for Network Security Groups.
Package networksecuritygroup provides a client for Network Security Groups.
osimage
Package osimage provides a client for Operating System Images.
Package osimage provides a client for Operating System Images.
sql
storageservice
Package storageservice provides a client for Storage Services.
Package storageservice provides a client for Storage Services.
testutils
Package testutils contains some test utilities for the Azure SDK
Package testutils contains some test utilities for the Azure SDK
virtualmachine
Package virtualmachine provides a client for Virtual Machines.
Package virtualmachine provides a client for Virtual Machines.
virtualmachinedisk
Package virtualmachinedisk provides a client for Virtual Machine Disks.
Package virtualmachinedisk provides a client for Virtual Machine Disks.
virtualmachineimage
Package virtualmachineimage provides a client for Virtual Machine Images.
Package virtualmachineimage provides a client for Virtual Machine Images.
virtualnetwork
Package virtualnetwork provides a client for Virtual Networks.
Package virtualnetwork provides a client for Virtual Networks.
vmutils
Package vmutils provides convenience methods for creating Virtual Machine Role configurations.
Package vmutils provides convenience methods for creating Virtual Machine Role configurations.
profile module
p20200901 Module
sdk
ai/azopenai Module
armcore Module
azcore Module
azidentity Module
data/azcosmos Module
data/aztables Module
internal Module
to Module
Package storage provides clients for Microsoft Azure Storage Services.
Package storage provides clients for Microsoft Azure Storage Services.
tools
apidiff Module
deprecate Module
generator Module
indexer Module
internal Module
pkgchk Module

Jump to

Keyboard shortcuts

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