forked from Azure/acs-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
interfaces.go
58 lines (43 loc) · 2.15 KB
/
interfaces.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package armhelpers
import (
"github.com/Azure/azure-sdk-for-go/arm/compute"
"github.com/Azure/azure-sdk-for-go/arm/resources/resources"
"github.com/Azure/go-autorest/autorest"
)
// ACSEngineClient is the interface used to talk to an Azure environment.
// This interface exposes just the subset of Azure APIs and clients needed for
// ACS-Engine.
type ACSEngineClient interface {
//AddAcceptLanguages sets the list of languages to accept on this request
AddAcceptLanguages(languages []string)
//
// RESOURCES
// DeployTemplate can deploy a template into Azure ARM
DeployTemplate(resourceGroup, name string, template, parameters map[string]interface{}, cancel <-chan struct{}) (*resources.DeploymentExtended, error)
// EnsureResourceGroup ensures the specified resource group exists in the specified location
EnsureResourceGroup(resourceGroup, location string) (*resources.Group, error)
//
// COMPUTE
// List lists VM resources
ListVirtualMachines(resourceGroup string) (compute.VirtualMachineListResult, error)
// GetVirtualMachine retrieves the specified virtual machine.
GetVirtualMachine(resourceGroup, name string) (compute.VirtualMachine, error)
// DeleteVirtualMachine deletes the specified virtual machine.
DeleteVirtualMachine(resourceGroup, name string, cancel <-chan struct{}) (<-chan compute.OperationStatusResponse, <-chan error)
// ListVirtualMachineScaleSets lists the vmss resources in the resource group
ListVirtualMachineScaleSets(resourceGroup string) (compute.VirtualMachineScaleSetListResult, error)
//
// STORAGE
// GetStorageClient uses SRP to retrieve keys, and then an authenticated client for talking to the specified storage
// account.
GetStorageClient(resourceGroup, accountName string) (ACSStorageClient, error)
//
// NETWORK
// DeleteNetworkInterface deletes the specified network interface.
DeleteNetworkInterface(resourceGroup, nicName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error)
}
// ACSStorageClient interface models the azure storage client
type ACSStorageClient interface {
// DeleteBlob deletes the specified blob in the specified container.
DeleteBlob(container, blob string) error
}