service

package
v0.20240402.1064951 Latest Latest
Warning

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

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

README

github.com/hashicorp/go-azure-sdk/resource-manager/servicefabric/2021-06-01/service Documentation

The service SDK allows for interaction with the Azure Resource Manager Service servicefabric (API Version 2021-06-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-sdk/resource-manager/servicefabric/2021-06-01/service"

Client Initialization

client := service.NewServiceClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: ServiceClient.CreateOrUpdate

ctx := context.TODO()
id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "applicationValue", "serviceValue")

payload := service.ServiceResource{
	// ...
}


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

Example Usage: ServiceClient.Delete

ctx := context.TODO()
id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "applicationValue", "serviceValue")

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

Example Usage: ServiceClient.Get

ctx := context.TODO()
id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "applicationValue", "serviceValue")

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: ServiceClient.List

ctx := context.TODO()
id := service.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "applicationValue")

// 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: ServiceClient.Update

ctx := context.TODO()
id := service.NewServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "applicationValue", "serviceValue")

payload := service.ServiceResourceUpdate{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForArmServicePackageActivationMode

func PossibleValuesForArmServicePackageActivationMode() []string

func PossibleValuesForMoveCost

func PossibleValuesForMoveCost() []string

func PossibleValuesForPartitionScheme

func PossibleValuesForPartitionScheme() []string

func PossibleValuesForServiceCorrelationScheme

func PossibleValuesForServiceCorrelationScheme() []string

func PossibleValuesForServiceKind

func PossibleValuesForServiceKind() []string

func PossibleValuesForServiceLoadMetricWeight

func PossibleValuesForServiceLoadMetricWeight() []string

func PossibleValuesForServicePlacementPolicyType

func PossibleValuesForServicePlacementPolicyType() []string

func ValidateApplicationID

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

ValidateApplicationID checks that 'input' can be parsed as a Application ID

func ValidateServiceID

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

ValidateServiceID checks that 'input' can be parsed as a Service ID

Types

type ApplicationId

type ApplicationId struct {
	SubscriptionId    string
	ResourceGroupName string
	ClusterName       string
	ApplicationName   string
}

ApplicationId is a struct representing the Resource ID for a Application

func NewApplicationID

func NewApplicationID(subscriptionId string, resourceGroupName string, clusterName string, applicationName string) ApplicationId

NewApplicationID returns a new ApplicationId struct

func ParseApplicationID

func ParseApplicationID(input string) (*ApplicationId, error)

ParseApplicationID parses 'input' into a ApplicationId

func ParseApplicationIDInsensitively

func ParseApplicationIDInsensitively(input string) (*ApplicationId, error)

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

func (*ApplicationId) FromParseResult

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

func (ApplicationId) ID

func (id ApplicationId) ID() string

ID returns the formatted Application ID

func (ApplicationId) Segments

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

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

func (ApplicationId) String

func (id ApplicationId) String() string

String returns a human-readable description of this Application ID

type ArmServicePackageActivationMode

type ArmServicePackageActivationMode string
const (
	ArmServicePackageActivationModeExclusiveProcess ArmServicePackageActivationMode = "ExclusiveProcess"
	ArmServicePackageActivationModeSharedProcess    ArmServicePackageActivationMode = "SharedProcess"
)

func (*ArmServicePackageActivationMode) UnmarshalJSON added in v0.20240222.1121651

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

type CreateOrUpdateOperationResponse

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

type DeleteOperationResponse

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

type GetOperationResponse

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

type ListCompleteResult

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

type ListOperationResponse

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

type MoveCost

type MoveCost string
const (
	MoveCostHigh   MoveCost = "High"
	MoveCostLow    MoveCost = "Low"
	MoveCostMedium MoveCost = "Medium"
	MoveCostZero   MoveCost = "Zero"
)

func (*MoveCost) UnmarshalJSON added in v0.20240222.1121651

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

type NamedPartitionSchemeDescription

type NamedPartitionSchemeDescription struct {
	Count int64    `json:"count"`
	Names []string `json:"names"`
}

func (NamedPartitionSchemeDescription) MarshalJSON

func (s NamedPartitionSchemeDescription) MarshalJSON() ([]byte, error)

type PartitionScheme

type PartitionScheme string
const (
	PartitionSchemeInvalid                PartitionScheme = "Invalid"
	PartitionSchemeNamed                  PartitionScheme = "Named"
	PartitionSchemeSingleton              PartitionScheme = "Singleton"
	PartitionSchemeUniformIntSixFourRange PartitionScheme = "UniformInt64Range"
)

func (*PartitionScheme) UnmarshalJSON added in v0.20240222.1121651

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

type PartitionSchemeDescription

type PartitionSchemeDescription interface {
}

type RawPartitionSchemeDescriptionImpl

type RawPartitionSchemeDescriptionImpl struct {
	Type   string
	Values map[string]interface{}
}

RawPartitionSchemeDescriptionImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RawServiceResourcePropertiesImpl

type RawServiceResourcePropertiesImpl struct {
	Type   string
	Values map[string]interface{}
}

RawServiceResourcePropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type RawServiceResourceUpdatePropertiesImpl

type RawServiceResourceUpdatePropertiesImpl struct {
	Type   string
	Values map[string]interface{}
}

RawServiceResourceUpdatePropertiesImpl is returned when the Discriminated Value doesn't match any of the defined types NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) and is used only for Deserialization (e.g. this cannot be used as a Request Payload).

type ServiceClient

type ServiceClient struct {
	Client *resourcemanager.Client
}

func NewServiceClientWithBaseURI

func NewServiceClientWithBaseURI(sdkApi sdkEnv.Api) (*ServiceClient, error)

func (ServiceClient) CreateOrUpdate

func (c ServiceClient) CreateOrUpdate(ctx context.Context, id ServiceId, input ServiceResource) (result CreateOrUpdateOperationResponse, err error)

CreateOrUpdate ...

func (ServiceClient) CreateOrUpdateThenPoll

func (c ServiceClient) CreateOrUpdateThenPoll(ctx context.Context, id ServiceId, input ServiceResource) error

CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed

func (ServiceClient) Delete

func (c ServiceClient) Delete(ctx context.Context, id ServiceId) (result DeleteOperationResponse, err error)

Delete ...

func (ServiceClient) DeleteThenPoll

func (c ServiceClient) DeleteThenPoll(ctx context.Context, id ServiceId) error

DeleteThenPoll performs Delete then polls until it's completed

func (ServiceClient) Get

func (c ServiceClient) Get(ctx context.Context, id ServiceId) (result GetOperationResponse, err error)

Get ...

func (ServiceClient) List

func (c ServiceClient) List(ctx context.Context, id ApplicationId) (result ListOperationResponse, err error)

List ...

func (ServiceClient) ListComplete

ListComplete retrieves all the results into a single object

func (ServiceClient) ListCompleteMatchingPredicate

func (c ServiceClient) ListCompleteMatchingPredicate(ctx context.Context, id ApplicationId, predicate ServiceResourceOperationPredicate) (result ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ServiceClient) Update

Update ...

func (ServiceClient) UpdateThenPoll

func (c ServiceClient) UpdateThenPoll(ctx context.Context, id ServiceId, input ServiceResourceUpdate) error

UpdateThenPoll performs Update then polls until it's completed

type ServiceCorrelationDescription

type ServiceCorrelationDescription struct {
	Scheme      ServiceCorrelationScheme `json:"scheme"`
	ServiceName string                   `json:"serviceName"`
}

type ServiceCorrelationScheme

type ServiceCorrelationScheme string
const (
	ServiceCorrelationSchemeAffinity           ServiceCorrelationScheme = "Affinity"
	ServiceCorrelationSchemeAlignedAffinity    ServiceCorrelationScheme = "AlignedAffinity"
	ServiceCorrelationSchemeInvalid            ServiceCorrelationScheme = "Invalid"
	ServiceCorrelationSchemeNonAlignedAffinity ServiceCorrelationScheme = "NonAlignedAffinity"
)

func (*ServiceCorrelationScheme) UnmarshalJSON added in v0.20240222.1121651

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

type ServiceId

type ServiceId struct {
	SubscriptionId    string
	ResourceGroupName string
	ClusterName       string
	ApplicationName   string
	ServiceName       string
}

ServiceId is a struct representing the Resource ID for a Service

func NewServiceID

func NewServiceID(subscriptionId string, resourceGroupName string, clusterName string, applicationName string, serviceName string) ServiceId

NewServiceID returns a new ServiceId struct

func ParseServiceID

func ParseServiceID(input string) (*ServiceId, error)

ParseServiceID parses 'input' into a ServiceId

func ParseServiceIDInsensitively

func ParseServiceIDInsensitively(input string) (*ServiceId, error)

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

func (*ServiceId) FromParseResult

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

func (ServiceId) ID

func (id ServiceId) ID() string

ID returns the formatted Service ID

func (ServiceId) Segments

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

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

func (ServiceId) String

func (id ServiceId) String() string

String returns a human-readable description of this Service ID

type ServiceKind

type ServiceKind string
const (
	ServiceKindInvalid   ServiceKind = "Invalid"
	ServiceKindStateful  ServiceKind = "Stateful"
	ServiceKindStateless ServiceKind = "Stateless"
)

func (*ServiceKind) UnmarshalJSON added in v0.20240222.1121651

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

type ServiceLoadMetricDescription

type ServiceLoadMetricDescription struct {
	DefaultLoad          *int64                   `json:"defaultLoad,omitempty"`
	Name                 string                   `json:"name"`
	PrimaryDefaultLoad   *int64                   `json:"primaryDefaultLoad,omitempty"`
	SecondaryDefaultLoad *int64                   `json:"secondaryDefaultLoad,omitempty"`
	Weight               *ServiceLoadMetricWeight `json:"weight,omitempty"`
}

type ServiceLoadMetricWeight

type ServiceLoadMetricWeight string
const (
	ServiceLoadMetricWeightHigh   ServiceLoadMetricWeight = "High"
	ServiceLoadMetricWeightLow    ServiceLoadMetricWeight = "Low"
	ServiceLoadMetricWeightMedium ServiceLoadMetricWeight = "Medium"
	ServiceLoadMetricWeightZero   ServiceLoadMetricWeight = "Zero"
)

func (*ServiceLoadMetricWeight) UnmarshalJSON added in v0.20240222.1121651

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

type ServicePlacementPolicyDescription

type ServicePlacementPolicyDescription struct {
	Type ServicePlacementPolicyType `json:"type"`
}

type ServicePlacementPolicyType

type ServicePlacementPolicyType string
const (
	ServicePlacementPolicyTypeInvalid                    ServicePlacementPolicyType = "Invalid"
	ServicePlacementPolicyTypeInvalidDomain              ServicePlacementPolicyType = "InvalidDomain"
	ServicePlacementPolicyTypeNonPartiallyPlaceService   ServicePlacementPolicyType = "NonPartiallyPlaceService"
	ServicePlacementPolicyTypePreferredPrimaryDomain     ServicePlacementPolicyType = "PreferredPrimaryDomain"
	ServicePlacementPolicyTypeRequiredDomain             ServicePlacementPolicyType = "RequiredDomain"
	ServicePlacementPolicyTypeRequiredDomainDistribution ServicePlacementPolicyType = "RequiredDomainDistribution"
)

func (*ServicePlacementPolicyType) UnmarshalJSON added in v0.20240222.1121651

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

type ServiceResource

type ServiceResource struct {
	Etag       *string                   `json:"etag,omitempty"`
	Id         *string                   `json:"id,omitempty"`
	Location   *string                   `json:"location,omitempty"`
	Name       *string                   `json:"name,omitempty"`
	Properties ServiceResourceProperties `json:"properties"`
	SystemData *SystemData               `json:"systemData,omitempty"`
	Tags       *map[string]string        `json:"tags,omitempty"`
	Type       *string                   `json:"type,omitempty"`
}

func (*ServiceResource) UnmarshalJSON

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

type ServiceResourceOperationPredicate

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

func (ServiceResourceOperationPredicate) Matches

type ServiceResourceProperties

type ServiceResourceProperties interface {
}

type ServiceResourceUpdate

type ServiceResourceUpdate struct {
	Etag       *string                         `json:"etag,omitempty"`
	Id         *string                         `json:"id,omitempty"`
	Location   *string                         `json:"location,omitempty"`
	Name       *string                         `json:"name,omitempty"`
	Properties ServiceResourceUpdateProperties `json:"properties"`
	SystemData *SystemData                     `json:"systemData,omitempty"`
	Tags       *map[string]string              `json:"tags,omitempty"`
	Type       *string                         `json:"type,omitempty"`
}

func (*ServiceResourceUpdate) UnmarshalJSON

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

type ServiceResourceUpdateProperties

type ServiceResourceUpdateProperties interface {
}

type SingletonPartitionSchemeDescription

type SingletonPartitionSchemeDescription struct {
}

func (SingletonPartitionSchemeDescription) MarshalJSON

func (s SingletonPartitionSchemeDescription) MarshalJSON() ([]byte, error)

type StatefulServiceProperties

type StatefulServiceProperties struct {
	HasPersistedState          *bool   `json:"hasPersistedState,omitempty"`
	MinReplicaSetSize          *int64  `json:"minReplicaSetSize,omitempty"`
	QuorumLossWaitDuration     *string `json:"quorumLossWaitDuration,omitempty"`
	ReplicaRestartWaitDuration *string `json:"replicaRestartWaitDuration,omitempty"`
	StandByReplicaKeepDuration *string `json:"standByReplicaKeepDuration,omitempty"`
	TargetReplicaSetSize       *int64  `json:"targetReplicaSetSize,omitempty"`

	// Fields inherited from ServiceResourceProperties
	CorrelationScheme            *[]ServiceCorrelationDescription     `json:"correlationScheme,omitempty"`
	DefaultMoveCost              *MoveCost                            `json:"defaultMoveCost,omitempty"`
	PartitionDescription         PartitionSchemeDescription           `json:"partitionDescription"`
	PlacementConstraints         *string                              `json:"placementConstraints,omitempty"`
	ProvisioningState            *string                              `json:"provisioningState,omitempty"`
	ServiceDnsName               *string                              `json:"serviceDnsName,omitempty"`
	ServiceLoadMetrics           *[]ServiceLoadMetricDescription      `json:"serviceLoadMetrics,omitempty"`
	ServicePackageActivationMode *ArmServicePackageActivationMode     `json:"servicePackageActivationMode,omitempty"`
	ServicePlacementPolicies     *[]ServicePlacementPolicyDescription `json:"servicePlacementPolicies,omitempty"`
	ServiceTypeName              *string                              `json:"serviceTypeName,omitempty"`
}

func (StatefulServiceProperties) MarshalJSON

func (s StatefulServiceProperties) MarshalJSON() ([]byte, error)

func (*StatefulServiceProperties) UnmarshalJSON

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

type StatefulServiceUpdateProperties

type StatefulServiceUpdateProperties struct {
	MinReplicaSetSize          *int64  `json:"minReplicaSetSize,omitempty"`
	QuorumLossWaitDuration     *string `json:"quorumLossWaitDuration,omitempty"`
	ReplicaRestartWaitDuration *string `json:"replicaRestartWaitDuration,omitempty"`
	StandByReplicaKeepDuration *string `json:"standByReplicaKeepDuration,omitempty"`
	TargetReplicaSetSize       *int64  `json:"targetReplicaSetSize,omitempty"`

	// Fields inherited from ServiceResourceUpdateProperties
	CorrelationScheme        *[]ServiceCorrelationDescription     `json:"correlationScheme,omitempty"`
	DefaultMoveCost          *MoveCost                            `json:"defaultMoveCost,omitempty"`
	PlacementConstraints     *string                              `json:"placementConstraints,omitempty"`
	ServiceLoadMetrics       *[]ServiceLoadMetricDescription      `json:"serviceLoadMetrics,omitempty"`
	ServicePlacementPolicies *[]ServicePlacementPolicyDescription `json:"servicePlacementPolicies,omitempty"`
}

func (StatefulServiceUpdateProperties) MarshalJSON

func (s StatefulServiceUpdateProperties) MarshalJSON() ([]byte, error)

type StatelessServiceProperties

type StatelessServiceProperties struct {
	InstanceCloseDelayDuration *string `json:"instanceCloseDelayDuration,omitempty"`
	InstanceCount              *int64  `json:"instanceCount,omitempty"`

	// Fields inherited from ServiceResourceProperties
	CorrelationScheme            *[]ServiceCorrelationDescription     `json:"correlationScheme,omitempty"`
	DefaultMoveCost              *MoveCost                            `json:"defaultMoveCost,omitempty"`
	PartitionDescription         PartitionSchemeDescription           `json:"partitionDescription"`
	PlacementConstraints         *string                              `json:"placementConstraints,omitempty"`
	ProvisioningState            *string                              `json:"provisioningState,omitempty"`
	ServiceDnsName               *string                              `json:"serviceDnsName,omitempty"`
	ServiceLoadMetrics           *[]ServiceLoadMetricDescription      `json:"serviceLoadMetrics,omitempty"`
	ServicePackageActivationMode *ArmServicePackageActivationMode     `json:"servicePackageActivationMode,omitempty"`
	ServicePlacementPolicies     *[]ServicePlacementPolicyDescription `json:"servicePlacementPolicies,omitempty"`
	ServiceTypeName              *string                              `json:"serviceTypeName,omitempty"`
}

func (StatelessServiceProperties) MarshalJSON

func (s StatelessServiceProperties) MarshalJSON() ([]byte, error)

func (*StatelessServiceProperties) UnmarshalJSON

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

type StatelessServiceUpdateProperties

type StatelessServiceUpdateProperties struct {
	InstanceCloseDelayDuration *string `json:"instanceCloseDelayDuration,omitempty"`
	InstanceCount              *int64  `json:"instanceCount,omitempty"`

	// Fields inherited from ServiceResourceUpdateProperties
	CorrelationScheme        *[]ServiceCorrelationDescription     `json:"correlationScheme,omitempty"`
	DefaultMoveCost          *MoveCost                            `json:"defaultMoveCost,omitempty"`
	PlacementConstraints     *string                              `json:"placementConstraints,omitempty"`
	ServiceLoadMetrics       *[]ServiceLoadMetricDescription      `json:"serviceLoadMetrics,omitempty"`
	ServicePlacementPolicies *[]ServicePlacementPolicyDescription `json:"servicePlacementPolicies,omitempty"`
}

func (StatelessServiceUpdateProperties) MarshalJSON

func (s StatelessServiceUpdateProperties) MarshalJSON() ([]byte, error)

type SystemData

type SystemData struct {
	CreatedAt          *string `json:"createdAt,omitempty"`
	CreatedBy          *string `json:"createdBy,omitempty"`
	CreatedByType      *string `json:"createdByType,omitempty"`
	LastModifiedAt     *string `json:"lastModifiedAt,omitempty"`
	LastModifiedBy     *string `json:"lastModifiedBy,omitempty"`
	LastModifiedByType *string `json:"lastModifiedByType,omitempty"`
}

func (*SystemData) GetCreatedAtAsTime

func (o *SystemData) GetCreatedAtAsTime() (*time.Time, error)

func (*SystemData) GetLastModifiedAtAsTime

func (o *SystemData) GetLastModifiedAtAsTime() (*time.Time, error)

func (*SystemData) SetCreatedAtAsTime

func (o *SystemData) SetCreatedAtAsTime(input time.Time)

func (*SystemData) SetLastModifiedAtAsTime

func (o *SystemData) SetLastModifiedAtAsTime(input time.Time)

type UniformInt64RangePartitionSchemeDescription

type UniformInt64RangePartitionSchemeDescription struct {
	Count   int64  `json:"count"`
	HighKey string `json:"highKey"`
	LowKey  string `json:"lowKey"`
}

func (UniformInt64RangePartitionSchemeDescription) MarshalJSON

type UpdateOperationResponse

type UpdateOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *ServiceResource
}

Jump to

Keyboard shortcuts

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