jitnetworkaccesspolicies

package
v0.20240625.1123713 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MPL-2.0 Imports: 14 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/security/2020-01-01/jitnetworkaccesspolicies Documentation

The jitnetworkaccesspolicies SDK allows for interaction with the Azure Resource Manager Service security (API Version 2020-01-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/security/2020-01-01/jitnetworkaccesspolicies"

Client Initialization

client := jitnetworkaccesspolicies.NewJitNetworkAccessPoliciesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: JitNetworkAccessPoliciesClient.CreateOrUpdate

ctx := context.TODO()
id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue", "jitNetworkAccessPolicyValue")

payload := jitnetworkaccesspolicies.JitNetworkAccessPolicy{
	// ...
}


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

Example Usage: JitNetworkAccessPoliciesClient.Delete

ctx := context.TODO()
id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue", "jitNetworkAccessPolicyValue")

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

Example Usage: JitNetworkAccessPoliciesClient.Get

ctx := context.TODO()
id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue", "jitNetworkAccessPolicyValue")

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: JitNetworkAccessPoliciesClient.Initiate

ctx := context.TODO()
id := jitnetworkaccesspolicies.NewJitNetworkAccessPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue", "jitNetworkAccessPolicyValue")

payload := jitnetworkaccesspolicies.JitNetworkAccessPolicyInitiateRequest{
	// ...
}


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

Example Usage: JitNetworkAccessPoliciesClient.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: JitNetworkAccessPoliciesClient.ListByRegion

ctx := context.TODO()
id := jitnetworkaccesspolicies.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue")

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

Example Usage: JitNetworkAccessPoliciesClient.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
}

Example Usage: JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForProtocol

func PossibleValuesForProtocol() []string

func PossibleValuesForStatus

func PossibleValuesForStatus() []string

func PossibleValuesForStatusReason

func PossibleValuesForStatusReason() []string

func ValidateJitNetworkAccessPolicyID

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

ValidateJitNetworkAccessPolicyID checks that 'input' can be parsed as a Jit Network Access Policy ID

func ValidateLocationID

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

ValidateLocationID checks that 'input' can be parsed as a Location ID

func ValidateProviderLocationID

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

ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID

Types

type CreateOrUpdateOperationResponse

type CreateOrUpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *JitNetworkAccessPolicy
}

type DeleteOperationResponse

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

type GetOperationResponse

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

type InitiateOperationResponse

type InitiateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *JitNetworkAccessRequest
}

type JitNetworkAccessPoliciesClient

type JitNetworkAccessPoliciesClient struct {
	Client *resourcemanager.Client
}

func NewJitNetworkAccessPoliciesClientWithBaseURI

func NewJitNetworkAccessPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*JitNetworkAccessPoliciesClient, error)

func (JitNetworkAccessPoliciesClient) CreateOrUpdate

CreateOrUpdate ...

func (JitNetworkAccessPoliciesClient) Delete

Delete ...

func (JitNetworkAccessPoliciesClient) Get

Get ...

func (JitNetworkAccessPoliciesClient) Initiate

Initiate ...

func (JitNetworkAccessPoliciesClient) List

List ...

func (JitNetworkAccessPoliciesClient) ListByRegion

ListByRegion ...

func (JitNetworkAccessPoliciesClient) ListByRegionComplete

ListByRegionComplete retrieves all the results into a single object

func (JitNetworkAccessPoliciesClient) ListByRegionCompleteMatchingPredicate

func (c JitNetworkAccessPoliciesClient) ListByRegionCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate JitNetworkAccessPolicyOperationPredicate) (result ListByRegionCompleteResult, err error)

ListByRegionCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (JitNetworkAccessPoliciesClient) ListByResourceGroup

ListByResourceGroup ...

func (JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegion

ListByResourceGroupAndRegion ...

func (JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionComplete

ListByResourceGroupAndRegionComplete retrieves all the results into a single object

func (JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionCompleteMatchingPredicate

func (c JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionCompleteMatchingPredicate(ctx context.Context, id ProviderLocationId, predicate JitNetworkAccessPolicyOperationPredicate) (result ListByResourceGroupAndRegionCompleteResult, err error)

ListByResourceGroupAndRegionCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (JitNetworkAccessPoliciesClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (JitNetworkAccessPoliciesClient) ListByResourceGroupCompleteMatchingPredicate

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (JitNetworkAccessPoliciesClient) ListComplete

ListComplete retrieves all the results into a single object

func (JitNetworkAccessPoliciesClient) ListCompleteMatchingPredicate

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

type JitNetworkAccessPolicy

type JitNetworkAccessPolicy struct {
	Id         *string                          `json:"id,omitempty"`
	Kind       *string                          `json:"kind,omitempty"`
	Location   *string                          `json:"location,omitempty"`
	Name       *string                          `json:"name,omitempty"`
	Properties JitNetworkAccessPolicyProperties `json:"properties"`
	Type       *string                          `json:"type,omitempty"`
}

type JitNetworkAccessPolicyId

type JitNetworkAccessPolicyId struct {
	SubscriptionId             string
	ResourceGroupName          string
	LocationName               string
	JitNetworkAccessPolicyName string
}

JitNetworkAccessPolicyId is a struct representing the Resource ID for a Jit Network Access Policy

func NewJitNetworkAccessPolicyID

func NewJitNetworkAccessPolicyID(subscriptionId string, resourceGroupName string, locationName string, jitNetworkAccessPolicyName string) JitNetworkAccessPolicyId

NewJitNetworkAccessPolicyID returns a new JitNetworkAccessPolicyId struct

func ParseJitNetworkAccessPolicyID

func ParseJitNetworkAccessPolicyID(input string) (*JitNetworkAccessPolicyId, error)

ParseJitNetworkAccessPolicyID parses 'input' into a JitNetworkAccessPolicyId

func ParseJitNetworkAccessPolicyIDInsensitively

func ParseJitNetworkAccessPolicyIDInsensitively(input string) (*JitNetworkAccessPolicyId, error)

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

func (*JitNetworkAccessPolicyId) FromParseResult

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

func (JitNetworkAccessPolicyId) ID

ID returns the formatted Jit Network Access Policy ID

func (JitNetworkAccessPolicyId) Segments

Segments returns a slice of Resource ID Segments which comprise this Jit Network Access Policy ID

func (JitNetworkAccessPolicyId) String

func (id JitNetworkAccessPolicyId) String() string

String returns a human-readable description of this Jit Network Access Policy ID

type JitNetworkAccessPolicyInitiatePort

type JitNetworkAccessPolicyInitiatePort struct {
	AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"`
	EndTimeUtc                 string  `json:"endTimeUtc"`
	Number                     int64   `json:"number"`
}

func (*JitNetworkAccessPolicyInitiatePort) GetEndTimeUtcAsTime

func (o *JitNetworkAccessPolicyInitiatePort) GetEndTimeUtcAsTime() (*time.Time, error)

func (*JitNetworkAccessPolicyInitiatePort) SetEndTimeUtcAsTime

func (o *JitNetworkAccessPolicyInitiatePort) SetEndTimeUtcAsTime(input time.Time)

type JitNetworkAccessPolicyInitiateRequest

type JitNetworkAccessPolicyInitiateRequest struct {
	Justification   *string                                        `json:"justification,omitempty"`
	VirtualMachines []JitNetworkAccessPolicyInitiateVirtualMachine `json:"virtualMachines"`
}

type JitNetworkAccessPolicyInitiateVirtualMachine

type JitNetworkAccessPolicyInitiateVirtualMachine struct {
	Id    string                               `json:"id"`
	Ports []JitNetworkAccessPolicyInitiatePort `json:"ports"`
}

type JitNetworkAccessPolicyOperationPredicate

type JitNetworkAccessPolicyOperationPredicate struct {
	Id       *string
	Kind     *string
	Location *string
	Name     *string
	Type     *string
}

func (JitNetworkAccessPolicyOperationPredicate) Matches

type JitNetworkAccessPolicyProperties

type JitNetworkAccessPolicyProperties struct {
	ProvisioningState *string                                `json:"provisioningState,omitempty"`
	Requests          *[]JitNetworkAccessRequest             `json:"requests,omitempty"`
	VirtualMachines   []JitNetworkAccessPolicyVirtualMachine `json:"virtualMachines"`
}

type JitNetworkAccessPolicyVirtualMachine

type JitNetworkAccessPolicyVirtualMachine struct {
	Id              string                     `json:"id"`
	Ports           []JitNetworkAccessPortRule `json:"ports"`
	PublicIPAddress *string                    `json:"publicIpAddress,omitempty"`
}

type JitNetworkAccessPortRule

type JitNetworkAccessPortRule struct {
	AllowedSourceAddressPrefix   *string   `json:"allowedSourceAddressPrefix,omitempty"`
	AllowedSourceAddressPrefixes *[]string `json:"allowedSourceAddressPrefixes,omitempty"`
	MaxRequestAccessDuration     string    `json:"maxRequestAccessDuration"`
	Number                       int64     `json:"number"`
	Protocol                     Protocol  `json:"protocol"`
}

type JitNetworkAccessRequest

type JitNetworkAccessRequest struct {
	Justification   *string                                 `json:"justification,omitempty"`
	Requestor       string                                  `json:"requestor"`
	StartTimeUtc    string                                  `json:"startTimeUtc"`
	VirtualMachines []JitNetworkAccessRequestVirtualMachine `json:"virtualMachines"`
}

func (*JitNetworkAccessRequest) GetStartTimeUtcAsTime

func (o *JitNetworkAccessRequest) GetStartTimeUtcAsTime() (*time.Time, error)

func (*JitNetworkAccessRequest) SetStartTimeUtcAsTime

func (o *JitNetworkAccessRequest) SetStartTimeUtcAsTime(input time.Time)

type JitNetworkAccessRequestPort

type JitNetworkAccessRequestPort struct {
	AllowedSourceAddressPrefix   *string      `json:"allowedSourceAddressPrefix,omitempty"`
	AllowedSourceAddressPrefixes *[]string    `json:"allowedSourceAddressPrefixes,omitempty"`
	EndTimeUtc                   string       `json:"endTimeUtc"`
	MappedPort                   *int64       `json:"mappedPort,omitempty"`
	Number                       int64        `json:"number"`
	Status                       Status       `json:"status"`
	StatusReason                 StatusReason `json:"statusReason"`
}

func (*JitNetworkAccessRequestPort) GetEndTimeUtcAsTime

func (o *JitNetworkAccessRequestPort) GetEndTimeUtcAsTime() (*time.Time, error)

func (*JitNetworkAccessRequestPort) SetEndTimeUtcAsTime

func (o *JitNetworkAccessRequestPort) SetEndTimeUtcAsTime(input time.Time)

type JitNetworkAccessRequestVirtualMachine

type JitNetworkAccessRequestVirtualMachine struct {
	Id    string                        `json:"id"`
	Ports []JitNetworkAccessRequestPort `json:"ports"`
}

type ListByRegionCompleteResult

type ListByRegionCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []JitNetworkAccessPolicy
}

type ListByRegionOperationResponse

type ListByRegionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]JitNetworkAccessPolicy
}

type ListByResourceGroupAndRegionCompleteResult

type ListByResourceGroupAndRegionCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []JitNetworkAccessPolicy
}

type ListByResourceGroupAndRegionOperationResponse

type ListByResourceGroupAndRegionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]JitNetworkAccessPolicy
}

type ListByResourceGroupCompleteResult

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

type ListByResourceGroupOperationResponse

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

type ListCompleteResult

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

type ListOperationResponse

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

type LocationId

type LocationId struct {
	SubscriptionId string
	LocationName   string
}

LocationId is a struct representing the Resource ID for a Location

func NewLocationID

func NewLocationID(subscriptionId string, locationName string) LocationId

NewLocationID returns a new LocationId struct

func ParseLocationID

func ParseLocationID(input string) (*LocationId, error)

ParseLocationID parses 'input' into a LocationId

func ParseLocationIDInsensitively

func ParseLocationIDInsensitively(input string) (*LocationId, error)

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

func (*LocationId) FromParseResult

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

func (LocationId) ID

func (id LocationId) ID() string

ID returns the formatted Location ID

func (LocationId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Location ID

func (LocationId) String

func (id LocationId) String() string

String returns a human-readable description of this Location ID

type Protocol

type Protocol string
const (
	ProtocolAny Protocol = "*"
	ProtocolTCP Protocol = "TCP"
	ProtocolUDP Protocol = "UDP"
)

func (*Protocol) UnmarshalJSON added in v0.20240228.1142829

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

type ProviderLocationId

type ProviderLocationId struct {
	SubscriptionId    string
	ResourceGroupName string
	LocationName      string
}

ProviderLocationId is a struct representing the Resource ID for a Provider Location

func NewProviderLocationID

func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId

NewProviderLocationID returns a new ProviderLocationId struct

func ParseProviderLocationID

func ParseProviderLocationID(input string) (*ProviderLocationId, error)

ParseProviderLocationID parses 'input' into a ProviderLocationId

func ParseProviderLocationIDInsensitively

func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error)

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

func (*ProviderLocationId) FromParseResult

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

func (ProviderLocationId) ID

func (id ProviderLocationId) ID() string

ID returns the formatted Provider Location ID

func (ProviderLocationId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Provider Location ID

func (ProviderLocationId) String

func (id ProviderLocationId) String() string

String returns a human-readable description of this Provider Location ID

type Status

type Status string
const (
	StatusInitiated Status = "Initiated"
	StatusRevoked   Status = "Revoked"
)

func (*Status) UnmarshalJSON added in v0.20240228.1142829

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

type StatusReason

type StatusReason string
const (
	StatusReasonExpired               StatusReason = "Expired"
	StatusReasonNewerRequestInitiated StatusReason = "NewerRequestInitiated"
	StatusReasonUserRequested         StatusReason = "UserRequested"
)

func (*StatusReason) UnmarshalJSON added in v0.20240228.1142829

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

Jump to

Keyboard shortcuts

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