jitrequests

package
v0.20240320.1143605 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MPL-2.0 Imports: 15 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/managedapplications/2021-07-01/jitrequests Documentation

The jitrequests SDK allows for interaction with the Azure Resource Manager Service managedapplications (API Version 2021-07-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/managedapplications/2021-07-01/jitrequests"

Client Initialization

client := jitrequests.NewJitRequestsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: JitRequestsClient.CreateOrUpdate

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

payload := jitrequests.JitRequestDefinition{
	// ...
}


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

Example Usage: JitRequestsClient.Delete

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

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: JitRequestsClient.Get

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

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: JitRequestsClient.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: JitRequestsClient.ListBySubscription

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

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

Example Usage: JitRequestsClient.Update

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

payload := jitrequests.JitRequestPatchable{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForJitRequestState

func PossibleValuesForJitRequestState() []string

func PossibleValuesForJitSchedulingType

func PossibleValuesForJitSchedulingType() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func ValidateJitRequestID

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

ValidateJitRequestID checks that 'input' can be parsed as a Jit Request ID

Types

type ApplicationClientDetails

type ApplicationClientDetails struct {
	ApplicationId *string `json:"applicationId,omitempty"`
	Oid           *string `json:"oid,omitempty"`
	Puid          *string `json:"puid,omitempty"`
}

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type GetOperationResponse

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

type JitAuthorizationPolicies

type JitAuthorizationPolicies struct {
	PrincipalId      string `json:"principalId"`
	RoleDefinitionId string `json:"roleDefinitionId"`
}

type JitRequestDefinition

type JitRequestDefinition struct {
	Id         *string                `json:"id,omitempty"`
	Location   *string                `json:"location,omitempty"`
	Name       *string                `json:"name,omitempty"`
	Properties *JitRequestProperties  `json:"properties,omitempty"`
	SystemData *systemdata.SystemData `json:"systemData,omitempty"`
	Tags       *map[string]string     `json:"tags,omitempty"`
	Type       *string                `json:"type,omitempty"`
}

type JitRequestDefinitionOperationPredicate added in v0.20240226.1173038

type JitRequestDefinitionOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (JitRequestDefinitionOperationPredicate) Matches added in v0.20240226.1173038

type JitRequestId

type JitRequestId struct {
	SubscriptionId    string
	ResourceGroupName string
	JitRequestName    string
}

JitRequestId is a struct representing the Resource ID for a Jit Request

func NewJitRequestID

func NewJitRequestID(subscriptionId string, resourceGroupName string, jitRequestName string) JitRequestId

NewJitRequestID returns a new JitRequestId struct

func ParseJitRequestID

func ParseJitRequestID(input string) (*JitRequestId, error)

ParseJitRequestID parses 'input' into a JitRequestId

func ParseJitRequestIDInsensitively

func ParseJitRequestIDInsensitively(input string) (*JitRequestId, error)

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

func (*JitRequestId) FromParseResult

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

func (JitRequestId) ID

func (id JitRequestId) ID() string

ID returns the formatted Jit Request ID

func (JitRequestId) Segments

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

Segments returns a slice of Resource ID Segments which comprise this Jit Request ID

func (JitRequestId) String

func (id JitRequestId) String() string

String returns a human-readable description of this Jit Request ID

type JitRequestPatchable

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

type JitRequestProperties

type JitRequestProperties struct {
	ApplicationResourceId    string                     `json:"applicationResourceId"`
	CreatedBy                *ApplicationClientDetails  `json:"createdBy,omitempty"`
	JitAuthorizationPolicies []JitAuthorizationPolicies `json:"jitAuthorizationPolicies"`
	JitRequestState          *JitRequestState           `json:"jitRequestState,omitempty"`
	JitSchedulingPolicy      JitSchedulingPolicy        `json:"jitSchedulingPolicy"`
	ProvisioningState        *ProvisioningState         `json:"provisioningState,omitempty"`
	PublisherTenantId        *string                    `json:"publisherTenantId,omitempty"`
	UpdatedBy                *ApplicationClientDetails  `json:"updatedBy,omitempty"`
}

type JitRequestState

type JitRequestState string
const (
	JitRequestStateApproved     JitRequestState = "Approved"
	JitRequestStateCanceled     JitRequestState = "Canceled"
	JitRequestStateDenied       JitRequestState = "Denied"
	JitRequestStateExpired      JitRequestState = "Expired"
	JitRequestStateFailed       JitRequestState = "Failed"
	JitRequestStateNotSpecified JitRequestState = "NotSpecified"
	JitRequestStatePending      JitRequestState = "Pending"
	JitRequestStateTimeout      JitRequestState = "Timeout"
)

func (*JitRequestState) UnmarshalJSON

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

type JitRequestsClient

type JitRequestsClient struct {
	Client *resourcemanager.Client
}

func NewJitRequestsClientWithBaseURI

func NewJitRequestsClientWithBaseURI(sdkApi sdkEnv.Api) (*JitRequestsClient, error)

func (JitRequestsClient) CreateOrUpdate

CreateOrUpdate ...

func (JitRequestsClient) CreateOrUpdateThenPoll

func (c JitRequestsClient) CreateOrUpdateThenPoll(ctx context.Context, id JitRequestId, input JitRequestDefinition) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (JitRequestsClient) Delete

Delete ...

func (JitRequestsClient) Get

Get ...

func (JitRequestsClient) ListByResourceGroup

ListByResourceGroup ...

func (JitRequestsClient) ListByResourceGroupComplete added in v0.20240226.1173038

ListByResourceGroupComplete retrieves all the results into a single object

func (JitRequestsClient) ListByResourceGroupCompleteMatchingPredicate added in v0.20240226.1173038

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

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (JitRequestsClient) ListBySubscription

ListBySubscription ...

func (JitRequestsClient) ListBySubscriptionComplete added in v0.20240226.1173038

ListBySubscriptionComplete retrieves all the results into a single object

func (JitRequestsClient) ListBySubscriptionCompleteMatchingPredicate added in v0.20240226.1173038

func (c JitRequestsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate JitRequestDefinitionOperationPredicate) (result ListBySubscriptionCompleteResult, err error)

ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (JitRequestsClient) Update

Update ...

type JitSchedulingPolicy

type JitSchedulingPolicy struct {
	Duration  string            `json:"duration"`
	StartTime string            `json:"startTime"`
	Type      JitSchedulingType `json:"type"`
}

func (*JitSchedulingPolicy) GetStartTimeAsTime

func (o *JitSchedulingPolicy) GetStartTimeAsTime() (*time.Time, error)

func (*JitSchedulingPolicy) SetStartTimeAsTime

func (o *JitSchedulingPolicy) SetStartTimeAsTime(input time.Time)

type JitSchedulingType

type JitSchedulingType string
const (
	JitSchedulingTypeNotSpecified JitSchedulingType = "NotSpecified"
	JitSchedulingTypeOnce         JitSchedulingType = "Once"
	JitSchedulingTypeRecurring    JitSchedulingType = "Recurring"
)

func (*JitSchedulingType) UnmarshalJSON

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

type ListByResourceGroupCompleteResult added in v0.20240226.1173038

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

type ListByResourceGroupOperationResponse

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

type ListBySubscriptionCompleteResult added in v0.20240226.1173038

type ListBySubscriptionCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []JitRequestDefinition
}

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]JitRequestDefinition
}

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateAccepted     ProvisioningState = "Accepted"
	ProvisioningStateCanceled     ProvisioningState = "Canceled"
	ProvisioningStateDeleted      ProvisioningState = "Deleted"
	ProvisioningStateDeleting     ProvisioningState = "Deleting"
	ProvisioningStateFailed       ProvisioningState = "Failed"
	ProvisioningStateNotSpecified ProvisioningState = "NotSpecified"
	ProvisioningStateRunning      ProvisioningState = "Running"
	ProvisioningStateSucceeded    ProvisioningState = "Succeeded"
	ProvisioningStateUpdating     ProvisioningState = "Updating"
)

func (*ProvisioningState) UnmarshalJSON

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

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *JitRequestDefinition
}

Jump to

Keyboard shortcuts

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