bastionhosts

package
v0.20240207.1162109 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MPL-2.0 Imports: 13 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/bastionhosts Documentation

The bastionhosts SDK allows for interaction with the Azure Resource Manager Service network (API Version 2023-09-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-09-01/bastionhosts"

Client Initialization

client := bastionhosts.NewBastionHostsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: BastionHostsClient.CreateOrUpdate

ctx := context.TODO()
id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue")

payload := bastionhosts.BastionHost{
	// ...
}


if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: BastionHostsClient.Delete

ctx := context.TODO()
id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue")

if err := client.DeleteThenPoll(ctx, id); err != nil {
	// handle the error
}
ctx := context.TODO()
id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue")

payload := bastionhosts.BastionShareableLinkListRequest{
	// ...
}


if err := client.DeleteBastionShareableLinkThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: BastionHostsClient.DeleteBastionShareableLinkByToken

ctx := context.TODO()
id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue")

payload := bastionhosts.BastionShareableLinkTokenListRequest{
	// ...
}


if err := client.DeleteBastionShareableLinkByTokenThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Example Usage: BastionHostsClient.DisconnectActiveSessions

ctx := context.TODO()
id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue")

payload := bastionhosts.SessionIds{
	// ...
}


// alternatively `client.DisconnectActiveSessions(ctx, id, payload)` can be used to do batched pagination
items, err := client.DisconnectActiveSessionsComplete(ctx, id, payload)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: BastionHostsClient.Get

ctx := context.TODO()
id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: BastionHostsClient.GetActiveSessions

ctx := context.TODO()
id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue")

// alternatively `client.GetActiveSessions(ctx, id)` can be used to do batched pagination
items, err := client.GetActiveSessionsComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}
ctx := context.TODO()
id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue")

payload := bastionhosts.BastionShareableLinkListRequest{
	// ...
}


// alternatively `client.GetBastionShareableLink(ctx, id, payload)` can be used to do batched pagination
items, err := client.GetBastionShareableLinkComplete(ctx, id, payload)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: BastionHostsClient.List

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

// alternatively `client.List(ctx, id)` can be used to do batched pagination
items, err := client.ListComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: BastionHostsClient.ListByResourceGroup

ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination
items, err := client.ListByResourceGroupComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}
ctx := context.TODO()
id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue")

payload := bastionhosts.BastionShareableLinkListRequest{
	// ...
}


// alternatively `client.PutBastionShareableLink(ctx, id, payload)` can be used to do batched pagination
items, err := client.PutBastionShareableLinkComplete(ctx, id, payload)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: BastionHostsClient.UpdateTags

ctx := context.TODO()
id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue")

payload := bastionhosts.TagsObject{
	// ...
}


if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil {
	// handle the error
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForBastionConnectProtocol

func PossibleValuesForBastionConnectProtocol() []string

func PossibleValuesForBastionHostSkuName

func PossibleValuesForBastionHostSkuName() []string

func PossibleValuesForIPAllocationMethod

func PossibleValuesForIPAllocationMethod() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func ValidateBastionHostID

func ValidateBastionHostID(input interface{}, key string) (warnings []string, errors []error)

ValidateBastionHostID checks that 'input' can be parsed as a Bastion Host ID

Types

type BastionActiveSession

type BastionActiveSession struct {
	Protocol              *BastionConnectProtocol `json:"protocol,omitempty"`
	ResourceType          *string                 `json:"resourceType,omitempty"`
	SessionDurationInMins *float64                `json:"sessionDurationInMins,omitempty"`
	SessionId             *string                 `json:"sessionId,omitempty"`
	StartTime             *interface{}            `json:"startTime,omitempty"`
	TargetHostName        *string                 `json:"targetHostName,omitempty"`
	TargetIPAddress       *string                 `json:"targetIpAddress,omitempty"`
	TargetResourceGroup   *string                 `json:"targetResourceGroup,omitempty"`
	TargetResourceId      *string                 `json:"targetResourceId,omitempty"`
	TargetSubscriptionId  *string                 `json:"targetSubscriptionId,omitempty"`
	UserName              *string                 `json:"userName,omitempty"`
}

type BastionActiveSessionOperationPredicate

type BastionActiveSessionOperationPredicate struct {
	ResourceType          *string
	SessionDurationInMins *float64
	SessionId             *string
	StartTime             *interface{}
	TargetHostName        *string
	TargetIPAddress       *string
	TargetResourceGroup   *string
	TargetResourceId      *string
	TargetSubscriptionId  *string
	UserName              *string
}

func (BastionActiveSessionOperationPredicate) Matches

type BastionConnectProtocol

type BastionConnectProtocol string
const (
	BastionConnectProtocolRDP BastionConnectProtocol = "RDP"
	BastionConnectProtocolSSH BastionConnectProtocol = "SSH"
)

func (*BastionConnectProtocol) UnmarshalJSON

func (s *BastionConnectProtocol) UnmarshalJSON(bytes []byte) error

type BastionHost

type BastionHost struct {
	Etag       *string                      `json:"etag,omitempty"`
	Id         *string                      `json:"id,omitempty"`
	Location   *string                      `json:"location,omitempty"`
	Name       *string                      `json:"name,omitempty"`
	Properties *BastionHostPropertiesFormat `json:"properties,omitempty"`
	Sku        *Sku                         `json:"sku,omitempty"`
	Tags       *map[string]string           `json:"tags,omitempty"`
	Type       *string                      `json:"type,omitempty"`
	Zones      *zones.Schema                `json:"zones,omitempty"`
}

type BastionHostIPConfiguration

type BastionHostIPConfiguration struct {
	Etag       *string                                     `json:"etag,omitempty"`
	Id         *string                                     `json:"id,omitempty"`
	Name       *string                                     `json:"name,omitempty"`
	Properties *BastionHostIPConfigurationPropertiesFormat `json:"properties,omitempty"`
	Type       *string                                     `json:"type,omitempty"`
}

type BastionHostIPConfigurationPropertiesFormat

type BastionHostIPConfigurationPropertiesFormat struct {
	PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
	ProvisioningState         *ProvisioningState  `json:"provisioningState,omitempty"`
	PublicIPAddress           SubResource         `json:"publicIPAddress"`
	Subnet                    SubResource         `json:"subnet"`
}

type BastionHostId

type BastionHostId struct {
	SubscriptionId    string
	ResourceGroupName string
	BastionHostName   string
}

BastionHostId is a struct representing the Resource ID for a Bastion Host

func NewBastionHostID

func NewBastionHostID(subscriptionId string, resourceGroupName string, bastionHostName string) BastionHostId

NewBastionHostID returns a new BastionHostId struct

func ParseBastionHostID

func ParseBastionHostID(input string) (*BastionHostId, error)

ParseBastionHostID parses 'input' into a BastionHostId

func ParseBastionHostIDInsensitively

func ParseBastionHostIDInsensitively(input string) (*BastionHostId, error)

ParseBastionHostIDInsensitively parses 'input' case-insensitively into a BastionHostId note: this method should only be used for API response data and not user input

func (*BastionHostId) FromParseResult

func (id *BastionHostId) FromParseResult(input resourceids.ParseResult) error

func (BastionHostId) ID

func (id BastionHostId) ID() string

ID returns the formatted Bastion Host ID

func (BastionHostId) Segments

func (id BastionHostId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Bastion Host ID

func (BastionHostId) String

func (id BastionHostId) String() string

String returns a human-readable description of this Bastion Host ID

type BastionHostOperationPredicate

type BastionHostOperationPredicate struct {
	Etag     *string
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (BastionHostOperationPredicate) Matches

type BastionHostPropertiesFormat

type BastionHostPropertiesFormat struct {
	DisableCopyPaste    *bool                                   `json:"disableCopyPaste,omitempty"`
	DnsName             *string                                 `json:"dnsName,omitempty"`
	EnableFileCopy      *bool                                   `json:"enableFileCopy,omitempty"`
	EnableIPConnect     *bool                                   `json:"enableIpConnect,omitempty"`
	EnableKerberos      *bool                                   `json:"enableKerberos,omitempty"`
	EnableShareableLink *bool                                   `json:"enableShareableLink,omitempty"`
	EnableTunneling     *bool                                   `json:"enableTunneling,omitempty"`
	IPConfigurations    *[]BastionHostIPConfiguration           `json:"ipConfigurations,omitempty"`
	NetworkAcls         *BastionHostPropertiesFormatNetworkAcls `json:"networkAcls,omitempty"`
	ProvisioningState   *ProvisioningState                      `json:"provisioningState,omitempty"`
	ScaleUnits          *int64                                  `json:"scaleUnits,omitempty"`
	VirtualNetwork      *SubResource                            `json:"virtualNetwork,omitempty"`
}

type BastionHostPropertiesFormatNetworkAcls

type BastionHostPropertiesFormatNetworkAcls struct {
	IPRules *[]IPRule `json:"ipRules,omitempty"`
}

type BastionHostSkuName

type BastionHostSkuName string
const (
	BastionHostSkuNameBasic     BastionHostSkuName = "Basic"
	BastionHostSkuNameDeveloper BastionHostSkuName = "Developer"
	BastionHostSkuNameStandard  BastionHostSkuName = "Standard"
)

func (*BastionHostSkuName) UnmarshalJSON

func (s *BastionHostSkuName) UnmarshalJSON(bytes []byte) error

type BastionHostsClient

type BastionHostsClient struct {
	Client *resourcemanager.Client
}

func NewBastionHostsClientWithBaseURI

func NewBastionHostsClientWithBaseURI(sdkApi sdkEnv.Api) (*BastionHostsClient, error)

func (BastionHostsClient) CreateOrUpdate

func (c BastionHostsClient) CreateOrUpdate(ctx context.Context, id BastionHostId, input BastionHost) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (BastionHostsClient) CreateOrUpdateThenPoll

func (c BastionHostsClient) CreateOrUpdateThenPoll(ctx context.Context, id BastionHostId, input BastionHost) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (BastionHostsClient) Delete

Delete ...

DeleteBastionShareableLink ...

func (BastionHostsClient) DeleteBastionShareableLinkByToken

DeleteBastionShareableLinkByToken ...

func (BastionHostsClient) DeleteBastionShareableLinkByTokenThenPoll

func (c BastionHostsClient) DeleteBastionShareableLinkByTokenThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkTokenListRequest) error

DeleteBastionShareableLinkByTokenThenPoll performs DeleteBastionShareableLinkByToken then polls until it's completed

func (BastionHostsClient) DeleteBastionShareableLinkThenPoll

func (c BastionHostsClient) DeleteBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error

DeleteBastionShareableLinkThenPoll performs DeleteBastionShareableLink then polls until it's completed

func (BastionHostsClient) DeleteThenPoll

func (c BastionHostsClient) DeleteThenPoll(ctx context.Context, id BastionHostId) error

DeleteThenPoll performs Delete then polls until it's completed

func (BastionHostsClient) DisconnectActiveSessions

func (c BastionHostsClient) DisconnectActiveSessions(ctx context.Context, id BastionHostId, input SessionIds) (result DisconnectActiveSessionsOperationResponse, err error)

DisconnectActiveSessions ...

func (BastionHostsClient) DisconnectActiveSessionsComplete

func (c BastionHostsClient) DisconnectActiveSessionsComplete(ctx context.Context, id BastionHostId, input SessionIds) (DisconnectActiveSessionsCompleteResult, error)

DisconnectActiveSessionsComplete retrieves all the results into a single object

func (BastionHostsClient) DisconnectActiveSessionsCompleteMatchingPredicate

func (c BastionHostsClient) DisconnectActiveSessionsCompleteMatchingPredicate(ctx context.Context, id BastionHostId, input SessionIds, predicate BastionSessionStateOperationPredicate) (result DisconnectActiveSessionsCompleteResult, err error)

DisconnectActiveSessionsCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (BastionHostsClient) Get

Get ...

func (BastionHostsClient) GetActiveSessions

func (c BastionHostsClient) GetActiveSessions(ctx context.Context, id BastionHostId) (result GetActiveSessionsOperationResponse, err error)

GetActiveSessions ...

func (BastionHostsClient) GetActiveSessionsThenPoll

func (c BastionHostsClient) GetActiveSessionsThenPoll(ctx context.Context, id BastionHostId) error

GetActiveSessionsThenPoll performs GetActiveSessions then polls until it's completed

GetBastionShareableLink ...

func (BastionHostsClient) GetBastionShareableLinkComplete

GetBastionShareableLinkComplete retrieves all the results into a single object

func (BastionHostsClient) GetBastionShareableLinkCompleteMatchingPredicate

func (c BastionHostsClient) GetBastionShareableLinkCompleteMatchingPredicate(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest, predicate BastionShareableLinkOperationPredicate) (result GetBastionShareableLinkCompleteResult, err error)

GetBastionShareableLinkCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (BastionHostsClient) List

List ...

func (BastionHostsClient) ListByResourceGroup

ListByResourceGroup ...

func (BastionHostsClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (BastionHostsClient) ListByResourceGroupCompleteMatchingPredicate

func (c BastionHostsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate BastionHostOperationPredicate) (result ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (BastionHostsClient) ListComplete

ListComplete retrieves all the results into a single object

func (BastionHostsClient) ListCompleteMatchingPredicate

func (c BastionHostsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate BastionHostOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

PutBastionShareableLink ...

func (BastionHostsClient) PutBastionShareableLinkThenPoll

func (c BastionHostsClient) PutBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error

PutBastionShareableLinkThenPoll performs PutBastionShareableLink then polls until it's completed

func (BastionHostsClient) UpdateTags

func (c BastionHostsClient) UpdateTags(ctx context.Context, id BastionHostId, input TagsObject) (result UpdateTagsOperationResponse, err error)

UpdateTags ...

func (BastionHostsClient) UpdateTagsThenPoll

func (c BastionHostsClient) UpdateTagsThenPoll(ctx context.Context, id BastionHostId, input TagsObject) error

UpdateTagsThenPoll performs UpdateTags then polls until it's completed

type BastionSessionState

type BastionSessionState struct {
	Message   *string `json:"message,omitempty"`
	SessionId *string `json:"sessionId,omitempty"`
	State     *string `json:"state,omitempty"`
}

type BastionSessionStateOperationPredicate

type BastionSessionStateOperationPredicate struct {
	Message   *string
	SessionId *string
	State     *string
}

func (BastionSessionStateOperationPredicate) Matches

type BastionShareableLink struct {
	Bsl       *string  `json:"bsl,omitempty"`
	CreatedAt *string  `json:"createdAt,omitempty"`
	Message   *string  `json:"message,omitempty"`
	VM        Resource `json:"vm"`
}

type BastionShareableLinkListRequest

type BastionShareableLinkListRequest struct {
	VMs *[]BastionShareableLink `json:"vms,omitempty"`
}

type BastionShareableLinkOperationPredicate

type BastionShareableLinkOperationPredicate struct {
	Bsl       *string
	CreatedAt *string
	Message   *string
}

func (BastionShareableLinkOperationPredicate) Matches

type BastionShareableLinkTokenListRequest

type BastionShareableLinkTokenListRequest struct {
	Tokens *[]string `json:"tokens,omitempty"`
}

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *BastionHost
}

type DeleteBastionShareableLinkByTokenOperationResponse

type DeleteBastionShareableLinkByTokenOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type DeleteBastionShareableLinkOperationResponse

type DeleteBastionShareableLinkOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type DeleteOperationResponse

type DeleteOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
}

type DisconnectActiveSessionsCompleteResult

type DisconnectActiveSessionsCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []BastionSessionState
}

type DisconnectActiveSessionsOperationResponse

type DisconnectActiveSessionsOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]BastionSessionState
}

type GetActiveSessionsCompleteResult

type GetActiveSessionsCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []BastionActiveSession
}

type GetActiveSessionsOperationResponse

type GetActiveSessionsOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]BastionActiveSession
}

type GetBastionShareableLinkCompleteResult

type GetBastionShareableLinkCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []BastionShareableLink
}

type GetBastionShareableLinkOperationResponse

type GetBastionShareableLinkOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]BastionShareableLink
}

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *BastionHost
}

type IPAllocationMethod

type IPAllocationMethod string
const (
	IPAllocationMethodDynamic IPAllocationMethod = "Dynamic"
	IPAllocationMethodStatic  IPAllocationMethod = "Static"
)

func (*IPAllocationMethod) UnmarshalJSON

func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error

type IPRule

type IPRule struct {
	AddressPrefix *string `json:"addressPrefix,omitempty"`
}

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []BastionHost
}

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]BastionHost
}

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []BastionHost
}

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]BastionHost
}

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
	ProvisioningStateUpdating  ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error

type PutBastionShareableLinkCompleteResult

type PutBastionShareableLinkCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []BastionShareableLink
}

type PutBastionShareableLinkOperationResponse

type PutBastionShareableLinkOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]BastionShareableLink
}

type Resource

type Resource struct {
	Id       *string            `json:"id,omitempty"`
	Location *string            `json:"location,omitempty"`
	Name     *string            `json:"name,omitempty"`
	Tags     *map[string]string `json:"tags,omitempty"`
	Type     *string            `json:"type,omitempty"`
}

type SessionIds

type SessionIds struct {
	SessionIds *[]string `json:"sessionIds,omitempty"`
}

type Sku

type Sku struct {
	Name *BastionHostSkuName `json:"name,omitempty"`
}

type SubResource

type SubResource struct {
	Id *string `json:"id,omitempty"`
}

type TagsObject

type TagsObject struct {
	Tags *map[string]string `json:"tags,omitempty"`
}

type UpdateTagsOperationResponse

type UpdateTagsOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *BastionHost
}

Jump to

Keyboard shortcuts

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