2022-09-05 03:06:08 -04:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2022-03-22 11:03:15 -04:00
|
|
|
package azure
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2022-07-27 16:02:33 -04:00
|
|
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
|
2023-08-24 01:55:56 -04:00
|
|
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5"
|
2023-12-20 09:58:55 -05:00
|
|
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v5"
|
2022-03-22 11:03:15 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
type imdsAPI interface {
|
2022-11-15 03:08:18 -05:00
|
|
|
providerID(ctx context.Context) (string, error)
|
|
|
|
name(ctx context.Context) (string, error)
|
|
|
|
resourceGroup(ctx context.Context) (string, error)
|
|
|
|
subscriptionID(ctx context.Context) (string, error)
|
|
|
|
uid(ctx context.Context) (string, error)
|
2022-11-26 13:44:34 -05:00
|
|
|
initSecretHash(ctx context.Context) (string, error)
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|
|
|
|
|
2022-05-24 04:04:42 -04:00
|
|
|
type virtualNetworksAPI interface {
|
2022-08-29 05:54:30 -04:00
|
|
|
NewListPager(resourceGroupName string,
|
|
|
|
options *armnetwork.VirtualNetworksClientListOptions,
|
|
|
|
) *runtime.Pager[armnetwork.VirtualNetworksClientListResponse]
|
2022-05-24 04:04:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type securityGroupsAPI interface {
|
2022-08-29 05:54:30 -04:00
|
|
|
NewListPager(resourceGroupName string,
|
|
|
|
options *armnetwork.SecurityGroupsClientListOptions,
|
|
|
|
) *runtime.Pager[armnetwork.SecurityGroupsClientListResponse]
|
2022-05-24 04:04:42 -04:00
|
|
|
}
|
|
|
|
|
2022-03-22 11:03:15 -04:00
|
|
|
type networkInterfacesAPI interface {
|
|
|
|
GetVirtualMachineScaleSetNetworkInterface(ctx context.Context, resourceGroupName string,
|
|
|
|
virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string,
|
|
|
|
options *armnetwork.InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceOptions,
|
|
|
|
) (armnetwork.InterfacesClientGetVirtualMachineScaleSetNetworkInterfaceResponse, error)
|
|
|
|
Get(ctx context.Context, resourceGroupName string, networkInterfaceName string,
|
|
|
|
options *armnetwork.InterfacesClientGetOptions) (armnetwork.InterfacesClientGetResponse, error)
|
|
|
|
}
|
|
|
|
|
2022-05-24 04:04:42 -04:00
|
|
|
type publicIPAddressesAPI interface {
|
|
|
|
GetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, resourceGroupName string,
|
|
|
|
virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string,
|
|
|
|
ipConfigurationName string, publicIPAddressName string,
|
|
|
|
options *armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressOptions,
|
|
|
|
) (armnetwork.PublicIPAddressesClientGetVirtualMachineScaleSetPublicIPAddressResponse, error)
|
|
|
|
Get(ctx context.Context, resourceGroupName string, publicIPAddressName string,
|
2022-08-29 05:54:30 -04:00
|
|
|
options *armnetwork.PublicIPAddressesClientGetOptions,
|
|
|
|
) (armnetwork.PublicIPAddressesClientGetResponse, error)
|
2022-05-24 04:04:42 -04:00
|
|
|
}
|
|
|
|
|
2022-03-22 11:03:15 -04:00
|
|
|
type virtualMachineScaleSetVMsAPI interface {
|
2022-07-27 16:02:33 -04:00
|
|
|
Get(ctx context.Context, resourceGroupName string, vmScaleSetName string, instanceID string,
|
2023-01-06 10:26:30 -05:00
|
|
|
options *armcompute.VirtualMachineScaleSetVMsClientGetOptions,
|
|
|
|
) (armcompute.VirtualMachineScaleSetVMsClientGetResponse, error)
|
2022-07-27 16:02:33 -04:00
|
|
|
NewListPager(resourceGroupName string, virtualMachineScaleSetName string,
|
2023-01-06 10:26:30 -05:00
|
|
|
options *armcompute.VirtualMachineScaleSetVMsClientListOptions,
|
|
|
|
) *runtime.Pager[armcompute.VirtualMachineScaleSetVMsClientListResponse]
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type scaleSetsAPI interface {
|
2023-01-06 10:26:30 -05:00
|
|
|
NewListPager(resourceGroupName string, options *armcompute.VirtualMachineScaleSetsClientListOptions,
|
|
|
|
) *runtime.Pager[armcompute.VirtualMachineScaleSetsClientListResponse]
|
2022-05-24 04:04:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type loadBalancerAPI interface {
|
2022-07-27 16:02:33 -04:00
|
|
|
NewListPager(resourceGroupName string, options *armnetwork.LoadBalancersClientListOptions,
|
|
|
|
) *runtime.Pager[armnetwork.LoadBalancersClientListResponse]
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|