Documentation ¶
Index ¶
- type AllowedEndpointRecordType
- type AlwaysServe
- type CheckTrafficManagerRelativeDNSNameAvailabilityParameters
- type ClientFactory
- func (c *ClientFactory) NewEndpointsClient() *EndpointsClient
- func (c *ClientFactory) NewGeographicHierarchiesClient() *GeographicHierarchiesClient
- func (c *ClientFactory) NewHeatMapClient() *HeatMapClient
- func (c *ClientFactory) NewProfilesClient() *ProfilesClient
- func (c *ClientFactory) NewUserMetricsKeysClient() *UserMetricsKeysClient
- type DNSConfig
- type DeleteOperationResult
- type Endpoint
- type EndpointMonitorStatus
- type EndpointProperties
- type EndpointPropertiesCustomHeadersItem
- type EndpointPropertiesSubnetsItem
- type EndpointStatus
- type EndpointType
- type EndpointsClient
- func (client *EndpointsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, ...) (EndpointsClientCreateOrUpdateResponse, error)
- func (client *EndpointsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, ...) (EndpointsClientDeleteResponse, error)
- func (client *EndpointsClient) Get(ctx context.Context, resourceGroupName string, profileName string, ...) (EndpointsClientGetResponse, error)
- func (client *EndpointsClient) Update(ctx context.Context, resourceGroupName string, profileName string, ...) (EndpointsClientUpdateResponse, error)
- type EndpointsClientCreateOrUpdateOptions
- type EndpointsClientCreateOrUpdateResponse
- type EndpointsClientDeleteOptions
- type EndpointsClientDeleteResponse
- type EndpointsClientGetOptions
- type EndpointsClientGetResponse
- type EndpointsClientUpdateOptions
- type EndpointsClientUpdateResponse
- type GeographicHierarchiesClient
- type GeographicHierarchiesClientGetDefaultOptions
- type GeographicHierarchiesClientGetDefaultResponse
- type GeographicHierarchy
- type GeographicHierarchyProperties
- type HeatMapClient
- type HeatMapClientGetOptions
- type HeatMapClientGetResponse
- type HeatMapEndpoint
- type HeatMapModel
- type HeatMapProperties
- type MonitorConfig
- type MonitorConfigCustomHeadersItem
- type MonitorConfigExpectedStatusCodeRangesItem
- type MonitorProtocol
- type NameAvailability
- type Profile
- type ProfileListResult
- type ProfileMonitorStatus
- type ProfileProperties
- type ProfileStatus
- type ProfilesClient
- func (client *ProfilesClient) CheckTrafficManagerNameAvailabilityV2(ctx context.Context, ...) (ProfilesClientCheckTrafficManagerNameAvailabilityV2Response, error)
- func (client *ProfilesClient) CheckTrafficManagerRelativeDNSNameAvailability(ctx context.Context, ...) (ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityResponse, error)
- func (client *ProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, ...) (ProfilesClientCreateOrUpdateResponse, error)
- func (client *ProfilesClient) Delete(ctx context.Context, resourceGroupName string, profileName string, ...) (ProfilesClientDeleteResponse, error)
- func (client *ProfilesClient) Get(ctx context.Context, resourceGroupName string, profileName string, ...) (ProfilesClientGetResponse, error)
- func (client *ProfilesClient) NewListByResourceGroupPager(resourceGroupName string, options *ProfilesClientListByResourceGroupOptions) *runtime.Pager[ProfilesClientListByResourceGroupResponse]
- func (client *ProfilesClient) NewListBySubscriptionPager(options *ProfilesClientListBySubscriptionOptions) *runtime.Pager[ProfilesClientListBySubscriptionResponse]
- func (client *ProfilesClient) Update(ctx context.Context, resourceGroupName string, profileName string, ...) (ProfilesClientUpdateResponse, error)
- type ProfilesClientCheckTrafficManagerNameAvailabilityV2Options
- type ProfilesClientCheckTrafficManagerNameAvailabilityV2Response
- type ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions
- type ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityResponse
- type ProfilesClientCreateOrUpdateOptions
- type ProfilesClientCreateOrUpdateResponse
- type ProfilesClientDeleteOptions
- type ProfilesClientDeleteResponse
- type ProfilesClientGetOptions
- type ProfilesClientGetResponse
- type ProfilesClientListByResourceGroupOptions
- type ProfilesClientListByResourceGroupResponse
- type ProfilesClientListBySubscriptionOptions
- type ProfilesClientListBySubscriptionResponse
- type ProfilesClientUpdateOptions
- type ProfilesClientUpdateResponse
- type ProxyResource
- type QueryExperience
- type Region
- type Resource
- type TrackedResource
- type TrafficFlow
- type TrafficRoutingMethod
- type TrafficViewEnrollmentStatus
- type UserMetricsKeysClient
- func (client *UserMetricsKeysClient) CreateOrUpdate(ctx context.Context, options *UserMetricsKeysClientCreateOrUpdateOptions) (UserMetricsKeysClientCreateOrUpdateResponse, error)
- func (client *UserMetricsKeysClient) Delete(ctx context.Context, options *UserMetricsKeysClientDeleteOptions) (UserMetricsKeysClientDeleteResponse, error)
- func (client *UserMetricsKeysClient) Get(ctx context.Context, options *UserMetricsKeysClientGetOptions) (UserMetricsKeysClientGetResponse, error)
- type UserMetricsKeysClientCreateOrUpdateOptions
- type UserMetricsKeysClientCreateOrUpdateResponse
- type UserMetricsKeysClientDeleteOptions
- type UserMetricsKeysClientDeleteResponse
- type UserMetricsKeysClientGetOptions
- type UserMetricsKeysClientGetResponse
- type UserMetricsModel
- type UserMetricsProperties
Examples ¶
- EndpointsClient.CreateOrUpdate (EndpointPutExternalWithAlwaysServe)
- EndpointsClient.CreateOrUpdate (EndpointPutExternalWithCustomHeaders)
- EndpointsClient.CreateOrUpdate (EndpointPutExternalWithGeoMapping)
- EndpointsClient.CreateOrUpdate (EndpointPutExternalWithLocation)
- EndpointsClient.CreateOrUpdate (EndpointPutExternalWithSubnetMapping)
- EndpointsClient.Delete
- EndpointsClient.Get (EndpointGetExternalWithGeoMapping)
- EndpointsClient.Get (EndpointGetExternalWithLocation)
- EndpointsClient.Get (EndpointGetExternalWithSubnetMapping)
- EndpointsClient.Update
- GeographicHierarchiesClient.GetDefault
- HeatMapClient.Get (HeatMapGet)
- HeatMapClient.Get (HeatMapGetWithNullValues)
- HeatMapClient.Get (HeatMapGetWithTopLeftBotRight)
- ProfilesClient.CheckTrafficManagerNameAvailabilityV2 (NameAvailabilityV2TestNameAvailablePost21)
- ProfilesClient.CheckTrafficManagerNameAvailabilityV2 (NameAvailabilityV2TestNameNotAvailablePost23)
- ProfilesClient.CheckTrafficManagerRelativeDNSNameAvailability (NameAvailabilityTestNameAvailablePost21)
- ProfilesClient.CheckTrafficManagerRelativeDNSNameAvailability (NameAvailabilityTestNameNotAvailablePost23)
- ProfilesClient.CreateOrUpdate (ProfilePutMultiValue)
- ProfilesClient.CreateOrUpdate (ProfilePutNoEndpoints)
- ProfilesClient.CreateOrUpdate (ProfilePutWithAliasing)
- ProfilesClient.CreateOrUpdate (ProfilePutWithCustomHeaders)
- ProfilesClient.CreateOrUpdate (ProfilePutWithEndpoints)
- ProfilesClient.CreateOrUpdate (ProfilePutWithNestedEndpoints)
- ProfilesClient.Delete
- ProfilesClient.Get (ProfileGetWithEndpoints)
- ProfilesClient.Get (ProfileGetWithTrafficViewDisabled)
- ProfilesClient.Get (ProfileGetWithTrafficViewEnabled)
- ProfilesClient.NewListByResourceGroupPager
- ProfilesClient.NewListBySubscriptionPager
- ProfilesClient.Update
- UserMetricsKeysClient.CreateOrUpdate
- UserMetricsKeysClient.Delete
- UserMetricsKeysClient.Get
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowedEndpointRecordType ¶
type AllowedEndpointRecordType string
AllowedEndpointRecordType - The allowed type DNS record types for this profile.
const ( AllowedEndpointRecordTypeAny AllowedEndpointRecordType = "Any" AllowedEndpointRecordTypeDomainName AllowedEndpointRecordType = "DomainName" AllowedEndpointRecordTypeIPv4Address AllowedEndpointRecordType = "IPv4Address" AllowedEndpointRecordTypeIPv6Address AllowedEndpointRecordType = "IPv6Address" )
func PossibleAllowedEndpointRecordTypeValues ¶
func PossibleAllowedEndpointRecordTypeValues() []AllowedEndpointRecordType
PossibleAllowedEndpointRecordTypeValues returns the possible values for the AllowedEndpointRecordType const type.
type AlwaysServe ¶ added in v1.2.0
type AlwaysServe string
AlwaysServe - If Always Serve is enabled, probing for endpoint health will be disabled and endpoints will be included in the traffic routing method.
const ( AlwaysServeDisabled AlwaysServe = "Disabled" AlwaysServeEnabled AlwaysServe = "Enabled" )
func PossibleAlwaysServeValues ¶ added in v1.2.0
func PossibleAlwaysServeValues() []AlwaysServe
PossibleAlwaysServeValues returns the possible values for the AlwaysServe const type.
type CheckTrafficManagerRelativeDNSNameAvailabilityParameters ¶
type CheckTrafficManagerRelativeDNSNameAvailabilityParameters struct { // The name of the resource. Name *string // The type of the resource. Type *string }
CheckTrafficManagerRelativeDNSNameAvailabilityParameters - Parameters supplied to check Traffic Manager name operation.
func (CheckTrafficManagerRelativeDNSNameAvailabilityParameters) MarshalJSON ¶ added in v1.1.0
func (c CheckTrafficManagerRelativeDNSNameAvailabilityParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type CheckTrafficManagerRelativeDNSNameAvailabilityParameters.
func (*CheckTrafficManagerRelativeDNSNameAvailabilityParameters) UnmarshalJSON ¶ added in v1.1.0
func (c *CheckTrafficManagerRelativeDNSNameAvailabilityParameters) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type CheckTrafficManagerRelativeDNSNameAvailabilityParameters.
type ClientFactory ¶ added in v1.1.0
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶ added in v1.1.0
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewEndpointsClient ¶ added in v1.1.0
func (c *ClientFactory) NewEndpointsClient() *EndpointsClient
NewEndpointsClient creates a new instance of EndpointsClient.
func (*ClientFactory) NewGeographicHierarchiesClient ¶ added in v1.1.0
func (c *ClientFactory) NewGeographicHierarchiesClient() *GeographicHierarchiesClient
NewGeographicHierarchiesClient creates a new instance of GeographicHierarchiesClient.
func (*ClientFactory) NewHeatMapClient ¶ added in v1.1.0
func (c *ClientFactory) NewHeatMapClient() *HeatMapClient
NewHeatMapClient creates a new instance of HeatMapClient.
func (*ClientFactory) NewProfilesClient ¶ added in v1.1.0
func (c *ClientFactory) NewProfilesClient() *ProfilesClient
NewProfilesClient creates a new instance of ProfilesClient.
func (*ClientFactory) NewUserMetricsKeysClient ¶ added in v1.1.0
func (c *ClientFactory) NewUserMetricsKeysClient() *UserMetricsKeysClient
NewUserMetricsKeysClient creates a new instance of UserMetricsKeysClient.
type DNSConfig ¶
type DNSConfig struct { // The relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by // Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the // profile. RelativeName *string // The DNS Time-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses // provided by this Traffic Manager profile. TTL *int64 // READ-ONLY; The fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation // of the RelativeName with the DNS domain used by Azure Traffic Manager. Fqdn *string }
DNSConfig - Class containing DNS settings in a Traffic Manager profile.
func (DNSConfig) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements the json.Marshaller interface for type DNSConfig.
func (*DNSConfig) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type DNSConfig.
type DeleteOperationResult ¶
type DeleteOperationResult struct { // READ-ONLY; The result of the operation or request. OperationResult *bool }
DeleteOperationResult - The result of the request or operation.
func (DeleteOperationResult) MarshalJSON ¶ added in v1.1.0
func (d DeleteOperationResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeleteOperationResult.
func (*DeleteOperationResult) UnmarshalJSON ¶ added in v1.1.0
func (d *DeleteOperationResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeleteOperationResult.
type Endpoint ¶
type Endpoint struct { // Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string // The name of the resource Name *string // The properties of the Traffic Manager endpoint. Properties *EndpointProperties // The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles. Type *string }
Endpoint - Class representing a Traffic Manager endpoint.
func (Endpoint) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Endpoint.
func (*Endpoint) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Endpoint.
type EndpointMonitorStatus ¶
type EndpointMonitorStatus string
EndpointMonitorStatus - The monitoring status of the endpoint.
const ( EndpointMonitorStatusCheckingEndpoint EndpointMonitorStatus = "CheckingEndpoint" EndpointMonitorStatusDegraded EndpointMonitorStatus = "Degraded" EndpointMonitorStatusDisabled EndpointMonitorStatus = "Disabled" EndpointMonitorStatusInactive EndpointMonitorStatus = "Inactive" EndpointMonitorStatusOnline EndpointMonitorStatus = "Online" EndpointMonitorStatusStopped EndpointMonitorStatus = "Stopped" EndpointMonitorStatusUnmonitored EndpointMonitorStatus = "Unmonitored" )
func PossibleEndpointMonitorStatusValues ¶
func PossibleEndpointMonitorStatusValues() []EndpointMonitorStatus
PossibleEndpointMonitorStatusValues returns the possible values for the EndpointMonitorStatus const type.
type EndpointProperties ¶
type EndpointProperties struct { // If Always Serve is enabled, probing for endpoint health will be disabled and endpoints will be included in the traffic // routing method. AlwaysServe *AlwaysServe // List of custom headers. CustomHeaders []*EndpointPropertiesCustomHeadersItem // Specifies the location of the external or nested endpoints when using the 'Performance' traffic routing method. EndpointLocation *string // The monitoring status of the endpoint. EndpointMonitorStatus *EndpointMonitorStatus // The status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic // routing method. EndpointStatus *EndpointStatus // The list of countries/regions mapped to this endpoint when using the 'Geographic' traffic routing method. Please consult // Traffic Manager Geographic documentation for a full list of accepted values. GeoMapping []*string // The minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered // available. Only applicable to endpoint of type 'NestedEndpoints'. MinChildEndpoints *int64 // The minimum number of IPv4 (DNS record type A) endpoints that must be available in the child profile in order for the parent // profile to be considered available. Only applicable to endpoint of type // 'NestedEndpoints'. MinChildEndpointsIPv4 *int64 // The minimum number of IPv6 (DNS record type AAAA) endpoints that must be available in the child profile in order for the // parent profile to be considered available. Only applicable to endpoint of type // 'NestedEndpoints'. MinChildEndpointsIPv6 *int64 // The priority of this endpoint when using the 'Priority' traffic routing method. Possible values are from 1 to 1000, lower // values represent higher priority. This is an optional parameter. If specified, // it must be specified on all endpoints, and no two endpoints can share the same priority value. Priority *int64 // The list of subnets, IP addresses, and/or address ranges mapped to this endpoint when using the 'Subnet' traffic routing // method. An empty list will match all ranges not covered by other endpoints. Subnets []*EndpointPropertiesSubnetsItem // The fully-qualified DNS name or IP address of the endpoint. Traffic Manager returns this value in DNS responses to direct // traffic to this endpoint. Target *string // The Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'. TargetResourceID *string // The weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000. Weight *int64 }
EndpointProperties - Class representing a Traffic Manager endpoint properties.
func (EndpointProperties) MarshalJSON ¶
func (e EndpointProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EndpointProperties.
func (*EndpointProperties) UnmarshalJSON ¶ added in v1.1.0
func (e *EndpointProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EndpointProperties.
type EndpointPropertiesCustomHeadersItem ¶
type EndpointPropertiesCustomHeadersItem struct { // Header name. Name *string // Header value. Value *string }
EndpointPropertiesCustomHeadersItem - Custom header name and value.
func (EndpointPropertiesCustomHeadersItem) MarshalJSON ¶ added in v1.1.0
func (e EndpointPropertiesCustomHeadersItem) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesCustomHeadersItem.
func (*EndpointPropertiesCustomHeadersItem) UnmarshalJSON ¶ added in v1.1.0
func (e *EndpointPropertiesCustomHeadersItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EndpointPropertiesCustomHeadersItem.
type EndpointPropertiesSubnetsItem ¶
type EndpointPropertiesSubnetsItem struct { // First address in the subnet. First *string // Last address in the subnet. Last *string // Block size (number of leading bits in the subnet mask). Scope *int32 }
EndpointPropertiesSubnetsItem - Subnet first address, scope, and/or last address.
func (EndpointPropertiesSubnetsItem) MarshalJSON ¶ added in v1.1.0
func (e EndpointPropertiesSubnetsItem) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type EndpointPropertiesSubnetsItem.
func (*EndpointPropertiesSubnetsItem) UnmarshalJSON ¶ added in v1.1.0
func (e *EndpointPropertiesSubnetsItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type EndpointPropertiesSubnetsItem.
type EndpointStatus ¶
type EndpointStatus string
EndpointStatus - The status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method.
const ( EndpointStatusDisabled EndpointStatus = "Disabled" EndpointStatusEnabled EndpointStatus = "Enabled" )
func PossibleEndpointStatusValues ¶
func PossibleEndpointStatusValues() []EndpointStatus
PossibleEndpointStatusValues returns the possible values for the EndpointStatus const type.
type EndpointType ¶ added in v0.3.0
type EndpointType string
const ( EndpointTypeAzureEndpoints EndpointType = "AzureEndpoints" EndpointTypeExternalEndpoints EndpointType = "ExternalEndpoints" EndpointTypeNestedEndpoints EndpointType = "NestedEndpoints" )
func PossibleEndpointTypeValues ¶ added in v0.3.0
func PossibleEndpointTypeValues() []EndpointType
PossibleEndpointTypeValues returns the possible values for the EndpointType const type.
type EndpointsClient ¶
type EndpointsClient struct {
// contains filtered or unexported fields
}
EndpointsClient contains the methods for the Endpoints group. Don't use this type directly, use NewEndpointsClient() instead.
func NewEndpointsClient ¶
func NewEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EndpointsClient, error)
NewEndpointsClient creates a new instance of EndpointsClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*EndpointsClient) CreateOrUpdate ¶
func (client *EndpointsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, endpointType EndpointType, endpointName string, parameters Endpoint, options *EndpointsClientCreateOrUpdateOptions) (EndpointsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update a Traffic Manager endpoint. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- profileName - The name of the Traffic Manager profile.
- endpointType - The type of the Traffic Manager endpoint to be created or updated.
- endpointName - The name of the Traffic Manager endpoint to be created or updated.
- parameters - The Traffic Manager endpoint parameters supplied to the CreateOrUpdate operation.
- options - EndpointsClientCreateOrUpdateOptions contains the optional parameters for the EndpointsClient.CreateOrUpdate method.
Example (EndpointPutExternalWithAlwaysServe) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithAlwaysServe.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEndpointsClient().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", armtrafficmanager.Endpoint{ Name: to.Ptr("azsmnet7187"), Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"), Properties: &armtrafficmanager.EndpointProperties{ AlwaysServe: to.Ptr(armtrafficmanager.AlwaysServeEnabled), EndpointLocation: to.Ptr("North Europe"), EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), Target: to.Ptr("foobar.contoso.com"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Endpoint = armtrafficmanager.Endpoint{ // Name: to.Ptr("azsmnet7187"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187"), // Properties: &armtrafficmanager.EndpointProperties{ // AlwaysServe: to.Ptr(armtrafficmanager.AlwaysServeEnabled), // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // } }
Output:
Example (EndpointPutExternalWithCustomHeaders) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithCustomHeaders.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEndpointsClient().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", armtrafficmanager.Endpoint{ Name: to.Ptr("azsmnet7187"), Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"), Properties: &armtrafficmanager.EndpointProperties{ CustomHeaders: []*armtrafficmanager.EndpointPropertiesCustomHeadersItem{ { Name: to.Ptr("header-1"), Value: to.Ptr("value-1"), }, { Name: to.Ptr("header-2"), Value: to.Ptr("value-2"), }}, EndpointLocation: to.Ptr("North Europe"), EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), Target: to.Ptr("foobar.contoso.com"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Endpoint = armtrafficmanager.Endpoint{ // Name: to.Ptr("azsmnet7187"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187"), // Properties: &armtrafficmanager.EndpointProperties{ // CustomHeaders: []*armtrafficmanager.EndpointPropertiesCustomHeadersItem{ // { // Name: to.Ptr("header-1"), // Value: to.Ptr("value-1"), // }, // { // Name: to.Ptr("header-2"), // Value: to.Ptr("value-2"), // }}, // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // } }
Output:
Example (EndpointPutExternalWithGeoMapping) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithGeoMapping.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEndpointsClient().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", armtrafficmanager.Endpoint{ Name: to.Ptr("My external endpoint"), Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"), Properties: &armtrafficmanager.EndpointProperties{ EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), GeoMapping: []*string{ to.Ptr("GEO-AS"), to.Ptr("GEO-AF")}, Target: to.Ptr("foobar.contoso.com"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Endpoint = armtrafficmanager.Endpoint{ // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager8224/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // GeoMapping: []*string{ // to.Ptr("GEO-AS"), // to.Ptr("GEO-AF")}, // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // } }
Output:
Example (EndpointPutExternalWithLocation) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithLocation.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEndpointsClient().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", armtrafficmanager.Endpoint{ Name: to.Ptr("azsmnet7187"), Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"), Properties: &armtrafficmanager.EndpointProperties{ EndpointLocation: to.Ptr("North Europe"), EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), Target: to.Ptr("foobar.contoso.com"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Endpoint = armtrafficmanager.Endpoint{ // Name: to.Ptr("azsmnet7187"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // } }
Output:
Example (EndpointPutExternalWithSubnetMapping) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PUT-External-WithSubnetMapping.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEndpointsClient().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", armtrafficmanager.Endpoint{ Name: to.Ptr("My external endpoint"), Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"), Properties: &armtrafficmanager.EndpointProperties{ EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), Subnets: []*armtrafficmanager.EndpointPropertiesSubnetsItem{ { First: to.Ptr("1.2.3.0"), Scope: to.Ptr[int32](24), }, { First: to.Ptr("25.26.27.28"), Last: to.Ptr("29.30.31.32"), }}, Target: to.Ptr("foobar.contoso.com"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Endpoint = armtrafficmanager.Endpoint{ // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager8224/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Subnets: []*armtrafficmanager.EndpointPropertiesSubnetsItem{ // { // First: to.Ptr("1.2.3.0"), // Scope: to.Ptr[int32](24), // }, // { // First: to.Ptr("25.26.27.28"), // Last: to.Ptr("29.30.31.32"), // }}, // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // } }
Output:
func (*EndpointsClient) Delete ¶
func (client *EndpointsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointType EndpointType, endpointName string, options *EndpointsClientDeleteOptions) (EndpointsClientDeleteResponse, error)
Delete - Deletes a Traffic Manager endpoint. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- profileName - The name of the Traffic Manager profile.
- endpointType - The type of the Traffic Manager endpoint to be deleted.
- endpointName - The name of the Traffic Manager endpoint to be deleted.
- options - EndpointsClientDeleteOptions contains the optional parameters for the EndpointsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-DELETE-External.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEndpointsClient().Delete(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DeleteOperationResult = armtrafficmanager.DeleteOperationResult{ // } }
Output:
func (*EndpointsClient) Get ¶
func (client *EndpointsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointType EndpointType, endpointName string, options *EndpointsClientGetOptions) (EndpointsClientGetResponse, error)
Get - Gets a Traffic Manager endpoint. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- profileName - The name of the Traffic Manager profile.
- endpointType - The type of the Traffic Manager endpoint.
- endpointName - The name of the Traffic Manager endpoint.
- options - EndpointsClientGetOptions contains the optional parameters for the EndpointsClient.Get method.
Example (EndpointGetExternalWithGeoMapping) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithGeoMapping.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEndpointsClient().Get(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Endpoint = armtrafficmanager.Endpoint{ // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager8224/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // GeoMapping: []*string{ // to.Ptr("GEO-AS"), // to.Ptr("GEO-AF")}, // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // } }
Output:
Example (EndpointGetExternalWithLocation) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithLocation.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEndpointsClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Endpoint = armtrafficmanager.Endpoint{ // Name: to.Ptr("azsmnet7187"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // } }
Output:
Example (EndpointGetExternalWithSubnetMapping) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-GET-External-WithSubnetMapping.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEndpointsClient().Get(ctx, "azuresdkfornetautoresttrafficmanager2191", "azuresdkfornetautoresttrafficmanager8224", armtrafficmanager.EndpointTypeExternalEndpoints, "My%20external%20endpoint", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Endpoint = armtrafficmanager.Endpoint{ // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2191/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager8224/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Subnets: []*armtrafficmanager.EndpointPropertiesSubnetsItem{ // { // First: to.Ptr("1.2.3.0"), // Scope: to.Ptr[int32](24), // }, // { // First: to.Ptr("25.26.27.28"), // Last: to.Ptr("29.30.31.32"), // }}, // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // } }
Output:
func (*EndpointsClient) Update ¶
func (client *EndpointsClient) Update(ctx context.Context, resourceGroupName string, profileName string, endpointType EndpointType, endpointName string, parameters Endpoint, options *EndpointsClientUpdateOptions) (EndpointsClientUpdateResponse, error)
Update - Update a Traffic Manager endpoint. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- profileName - The name of the Traffic Manager profile.
- endpointType - The type of the Traffic Manager endpoint to be updated.
- endpointName - The name of the Traffic Manager endpoint to be updated.
- parameters - The Traffic Manager endpoint parameters supplied to the Update operation.
- options - EndpointsClientUpdateOptions contains the optional parameters for the EndpointsClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Endpoint-PATCH-External-Target.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewEndpointsClient().Update(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.EndpointTypeExternalEndpoints, "azsmnet7187", armtrafficmanager.Endpoint{ Name: to.Ptr("azsmnet7187"), Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187"), Properties: &armtrafficmanager.EndpointProperties{ Target: to.Ptr("another.foobar.contoso.com"), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Endpoint = armtrafficmanager.Endpoint{ // Name: to.Ptr("azsmnet7187"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386/externalEndpoints/azsmnet7187"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("another.foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // } }
Output:
type EndpointsClientCreateOrUpdateOptions ¶ added in v0.2.0
type EndpointsClientCreateOrUpdateOptions struct { }
EndpointsClientCreateOrUpdateOptions contains the optional parameters for the EndpointsClient.CreateOrUpdate method.
type EndpointsClientCreateOrUpdateResponse ¶ added in v0.2.0
type EndpointsClientCreateOrUpdateResponse struct { // Class representing a Traffic Manager endpoint. Endpoint }
EndpointsClientCreateOrUpdateResponse contains the response from method EndpointsClient.CreateOrUpdate.
type EndpointsClientDeleteOptions ¶ added in v0.2.0
type EndpointsClientDeleteOptions struct { }
EndpointsClientDeleteOptions contains the optional parameters for the EndpointsClient.Delete method.
type EndpointsClientDeleteResponse ¶ added in v0.2.0
type EndpointsClientDeleteResponse struct { // The result of the request or operation. DeleteOperationResult }
EndpointsClientDeleteResponse contains the response from method EndpointsClient.Delete.
type EndpointsClientGetOptions ¶ added in v0.2.0
type EndpointsClientGetOptions struct { }
EndpointsClientGetOptions contains the optional parameters for the EndpointsClient.Get method.
type EndpointsClientGetResponse ¶ added in v0.2.0
type EndpointsClientGetResponse struct { // Class representing a Traffic Manager endpoint. Endpoint }
EndpointsClientGetResponse contains the response from method EndpointsClient.Get.
type EndpointsClientUpdateOptions ¶ added in v0.2.0
type EndpointsClientUpdateOptions struct { }
EndpointsClientUpdateOptions contains the optional parameters for the EndpointsClient.Update method.
type EndpointsClientUpdateResponse ¶ added in v0.2.0
type EndpointsClientUpdateResponse struct { // Class representing a Traffic Manager endpoint. Endpoint }
EndpointsClientUpdateResponse contains the response from method EndpointsClient.Update.
type GeographicHierarchiesClient ¶
type GeographicHierarchiesClient struct {
// contains filtered or unexported fields
}
GeographicHierarchiesClient contains the methods for the GeographicHierarchies group. Don't use this type directly, use NewGeographicHierarchiesClient() instead.
func NewGeographicHierarchiesClient ¶
func NewGeographicHierarchiesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GeographicHierarchiesClient, error)
NewGeographicHierarchiesClient creates a new instance of GeographicHierarchiesClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*GeographicHierarchiesClient) GetDefault ¶
func (client *GeographicHierarchiesClient) GetDefault(ctx context.Context, options *GeographicHierarchiesClientGetDefaultOptions) (GeographicHierarchiesClientGetDefaultResponse, error)
GetDefault - Gets the default Geographic Hierarchy used by the Geographic traffic routing method. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- options - GeographicHierarchiesClientGetDefaultOptions contains the optional parameters for the GeographicHierarchiesClient.GetDefault method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/GeographicHierarchy-GET-default.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewGeographicHierarchiesClient().GetDefault(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.GeographicHierarchy = armtrafficmanager.GeographicHierarchy{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Network/trafficManagerGeographicHierarchies"), // ID: to.Ptr("/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default"), // Properties: &armtrafficmanager.GeographicHierarchyProperties{ // GeographicHierarchy: &armtrafficmanager.Region{ // Name: to.Ptr("World"), // Code: to.Ptr("WORLD"), // Regions: []*armtrafficmanager.Region{ // { // Name: to.Ptr("Middle East"), // Code: to.Ptr("GEO-ME"), // Regions: []*armtrafficmanager.Region{ // { // Name: to.Ptr("United Arab Emirates"), // Code: to.Ptr("AE"), // Regions: []*armtrafficmanager.Region{ // }, // }}, // }, // { // Name: to.Ptr("Australia / Pacific"), // Code: to.Ptr("GEO-AP"), // Regions: []*armtrafficmanager.Region{ // { // Name: to.Ptr("Australia"), // Code: to.Ptr("AU"), // Regions: []*armtrafficmanager.Region{ // { // Name: to.Ptr("Australian Capital Territory"), // Code: to.Ptr("AU-ACT"), // Regions: []*armtrafficmanager.Region{ // }, // }, // { // Name: to.Ptr("New South Wales"), // Code: to.Ptr("AU-NSW"), // Regions: []*armtrafficmanager.Region{ // }, // }}, // }, // { // Name: to.Ptr("Cook Islands"), // Code: to.Ptr("CK"), // Regions: []*armtrafficmanager.Region{ // }, // }}, // }}, // }, // }, // } }
Output:
type GeographicHierarchiesClientGetDefaultOptions ¶ added in v0.2.0
type GeographicHierarchiesClientGetDefaultOptions struct { }
GeographicHierarchiesClientGetDefaultOptions contains the optional parameters for the GeographicHierarchiesClient.GetDefault method.
type GeographicHierarchiesClientGetDefaultResponse ¶ added in v0.2.0
type GeographicHierarchiesClientGetDefaultResponse struct { // Class representing the Geographic hierarchy used with the Geographic traffic routing method. GeographicHierarchy }
GeographicHierarchiesClientGetDefaultResponse contains the response from method GeographicHierarchiesClient.GetDefault.
type GeographicHierarchy ¶ added in v0.2.0
type GeographicHierarchy struct { // Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string // The name of the resource Name *string // The properties of the Geographic Hierarchy resource. Properties *GeographicHierarchyProperties // The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles. Type *string }
GeographicHierarchy - Class representing the Geographic hierarchy used with the Geographic traffic routing method.
func (GeographicHierarchy) MarshalJSON ¶ added in v1.1.0
func (g GeographicHierarchy) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GeographicHierarchy.
func (*GeographicHierarchy) UnmarshalJSON ¶ added in v1.1.0
func (g *GeographicHierarchy) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GeographicHierarchy.
type GeographicHierarchyProperties ¶
type GeographicHierarchyProperties struct { // The region at the root of the hierarchy from all the regions in the hierarchy can be retrieved. GeographicHierarchy *Region }
GeographicHierarchyProperties - Class representing the properties of the Geographic hierarchy used with the Geographic traffic routing method.
func (GeographicHierarchyProperties) MarshalJSON ¶ added in v1.1.0
func (g GeographicHierarchyProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type GeographicHierarchyProperties.
func (*GeographicHierarchyProperties) UnmarshalJSON ¶ added in v1.1.0
func (g *GeographicHierarchyProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type GeographicHierarchyProperties.
type HeatMapClient ¶
type HeatMapClient struct {
// contains filtered or unexported fields
}
HeatMapClient contains the methods for the HeatMap group. Don't use this type directly, use NewHeatMapClient() instead.
func NewHeatMapClient ¶
func NewHeatMapClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HeatMapClient, error)
NewHeatMapClient creates a new instance of HeatMapClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*HeatMapClient) Get ¶
func (client *HeatMapClient) Get(ctx context.Context, resourceGroupName string, profileName string, options *HeatMapClientGetOptions) (HeatMapClientGetResponse, error)
Get - Gets latest heatmap for Traffic Manager profile. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- profileName - The name of the Traffic Manager profile.
- options - HeatMapClientGetOptions contains the optional parameters for the HeatMapClient.Get method.
Example (HeatMapGet) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/HeatMap-GET.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewHeatMapClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", &armtrafficmanager.HeatMapClientGetOptions{TopLeft: []float64{}, BotRight: []float64{}, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.HeatMapModel = armtrafficmanager.HeatMapModel{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/heatMaps/latencyVolumeByLocation"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/heatMaps/latencyVolumeByLocation"), // Properties: &armtrafficmanager.HeatMapProperties{ // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-22T12:50:00.000Z"); return t}()), // Endpoints: []*armtrafficmanager.HeatMapEndpoint{ // { // EndpointID: to.Ptr[int32](1), // ResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/azuresdkfornetautoresttrafficmanager3880"), // }, // { // EndpointID: to.Ptr[int32](2), // ResourceID: to.Ptr("/subscriptions/562d4115-c01e-4m67-9bbd-c11c2d58ad73/resourceGroups/azuresdkfornetautoresttrafficmanager1300/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3885/externalEndpoints/azuresdkfornetautoresttrafficmanager3881"), // }}, // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T12:00:00.000Z"); return t}()), // TrafficFlows: []*armtrafficmanager.TrafficFlow{ // { // Latitude: to.Ptr[float64](99.99), // Longitude: to.Ptr[float64](0), // QueryExperiences: []*armtrafficmanager.QueryExperience{ // { // EndpointID: to.Ptr[int32](1), // Latency: to.Ptr[float64](99.222), // QueryCount: to.Ptr[int32](1000000), // }, // { // EndpointID: to.Ptr[int32](2), // Latency: to.Ptr[float64](1.222), // QueryCount: to.Ptr[int32](1), // }}, // SourceIP: to.Ptr("1.1.1.1"), // }, // { // Latitude: to.Ptr[float64](-99.99), // Longitude: to.Ptr[float64](1), // QueryExperiences: []*armtrafficmanager.QueryExperience{ // { // EndpointID: to.Ptr[int32](1), // Latency: to.Ptr[float64](96.222), // QueryCount: to.Ptr[int32](100), // }, // { // EndpointID: to.Ptr[int32](2), // Latency: to.Ptr[float64](4.222), // QueryCount: to.Ptr[int32](500), // }}, // SourceIP: to.Ptr("2.255.1.1"), // }}, // }, // } }
Output:
Example (HeatMapGetWithNullValues) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/HeatMap-GET-With-Null-Values.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewHeatMapClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", &armtrafficmanager.HeatMapClientGetOptions{TopLeft: []float64{}, BotRight: []float64{}, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.HeatMapModel = armtrafficmanager.HeatMapModel{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/heatMaps/default"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/heatMaps/default"), // Properties: &armtrafficmanager.HeatMapProperties{ // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-22T12:50:00.000Z"); return t}()), // Endpoints: []*armtrafficmanager.HeatMapEndpoint{ // { // EndpointID: to.Ptr[int32](0), // ResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/azuresdkfornetautoresttrafficmanager3880"), // }, // { // EndpointID: to.Ptr[int32](1), // ResourceID: to.Ptr("/subscriptions/562d4115-c01e-4m67-9bbd-c11c2d58ad73/resourceGroups/azuresdkfornetautoresttrafficmanager1300/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3885/externalEndpoints/azuresdkfornetautoresttrafficmanager3881"), // }}, // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T12:00:00.000Z"); return t}()), // TrafficFlows: []*armtrafficmanager.TrafficFlow{ // { // Latitude: to.Ptr[float64](99.99), // Longitude: to.Ptr[float64](0), // QueryExperiences: []*armtrafficmanager.QueryExperience{ // { // EndpointID: to.Ptr[int32](0), // Latency: to.Ptr[float64](99), // QueryCount: to.Ptr[int32](1000000), // }, // { // EndpointID: to.Ptr[int32](1), // Latency: to.Ptr[float64](1), // QueryCount: to.Ptr[int32](1), // }}, // SourceIP: to.Ptr("1.1.1.1"), // }, // { // Latitude: to.Ptr[float64](1.11), // Longitude: to.Ptr[float64](-2.35), // QueryExperiences: []*armtrafficmanager.QueryExperience{ // { // EndpointID: to.Ptr[int32](0), // QueryCount: to.Ptr[int32](100), // }, // { // EndpointID: to.Ptr[int32](1), // Latency: to.Ptr[float64](4.222), // QueryCount: to.Ptr[int32](500), // }}, // SourceIP: to.Ptr("2.255.1.1"), // }}, // }, // } }
Output:
Example (HeatMapGetWithTopLeftBotRight) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/HeatMap-GET-With-TopLeft-BotRight.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewHeatMapClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", &armtrafficmanager.HeatMapClientGetOptions{TopLeft: []float64{ 10, 50.001}, BotRight: []float64{ -50.001, 80}, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.HeatMapModel = armtrafficmanager.HeatMapModel{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/heatMaps/latencyVolumeByLocation"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/heatMaps/latencyVolumeByLocation"), // Properties: &armtrafficmanager.HeatMapProperties{ // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-22T12:50:00.000Z"); return t}()), // Endpoints: []*armtrafficmanager.HeatMapEndpoint{ // { // EndpointID: to.Ptr[int32](1), // ResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/azuresdkfornetautoresttrafficmanager3880"), // }, // { // EndpointID: to.Ptr[int32](2), // ResourceID: to.Ptr("/subscriptions/562d4115-c01e-4m67-9bbd-c11c2d58ad73/resourceGroups/azuresdkfornetautoresttrafficmanager1300/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3885/externalEndpoints/azuresdkfornetautoresttrafficmanager3881"), // }}, // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-15T12:00:00.000Z"); return t}()), // TrafficFlows: []*armtrafficmanager.TrafficFlow{ // { // Latitude: to.Ptr[float64](9.99), // Longitude: to.Ptr[float64](75.01), // QueryExperiences: []*armtrafficmanager.QueryExperience{ // { // EndpointID: to.Ptr[int32](1), // Latency: to.Ptr[float64](99.222), // QueryCount: to.Ptr[int32](1000000), // }, // { // EndpointID: to.Ptr[int32](2), // Latency: to.Ptr[float64](1.222), // QueryCount: to.Ptr[int32](1), // }}, // SourceIP: to.Ptr("1.1.1.1"), // }, // { // Latitude: to.Ptr[float64](-49.99), // Longitude: to.Ptr[float64](51), // QueryExperiences: []*armtrafficmanager.QueryExperience{ // { // EndpointID: to.Ptr[int32](1), // Latency: to.Ptr[float64](96.222), // QueryCount: to.Ptr[int32](100), // }, // { // EndpointID: to.Ptr[int32](2), // Latency: to.Ptr[float64](4.222), // QueryCount: to.Ptr[int32](500), // }}, // SourceIP: to.Ptr("2.255.1.1"), // }}, // }, // } }
Output:
type HeatMapClientGetOptions ¶ added in v0.2.0
type HeatMapClientGetOptions struct { // The bottom right latitude,longitude pair of the rectangular viewport to query for. BotRight []float64 // The top left latitude,longitude pair of the rectangular viewport to query for. TopLeft []float64 }
HeatMapClientGetOptions contains the optional parameters for the HeatMapClient.Get method.
type HeatMapClientGetResponse ¶ added in v0.2.0
type HeatMapClientGetResponse struct { // Class representing a Traffic Manager HeatMap. HeatMapModel }
HeatMapClientGetResponse contains the response from method HeatMapClient.Get.
type HeatMapEndpoint ¶
type HeatMapEndpoint struct { // A number uniquely identifying this endpoint in query experiences. EndpointID *int32 // The ARM Resource ID of this Traffic Manager endpoint. ResourceID *string }
HeatMapEndpoint - Class which is a sparse representation of a Traffic Manager endpoint.
func (HeatMapEndpoint) MarshalJSON ¶ added in v1.1.0
func (h HeatMapEndpoint) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type HeatMapEndpoint.
func (*HeatMapEndpoint) UnmarshalJSON ¶ added in v1.1.0
func (h *HeatMapEndpoint) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type HeatMapEndpoint.
type HeatMapModel ¶
type HeatMapModel struct { // Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string // The name of the resource Name *string // The properties of the Traffic Manager HeatMap. Properties *HeatMapProperties // The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles. Type *string }
HeatMapModel - Class representing a Traffic Manager HeatMap.
func (HeatMapModel) MarshalJSON ¶
func (h HeatMapModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type HeatMapModel.
func (*HeatMapModel) UnmarshalJSON ¶ added in v1.1.0
func (h *HeatMapModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type HeatMapModel.
type HeatMapProperties ¶
type HeatMapProperties struct { // The ending of the time window for this HeatMap, exclusive. EndTime *time.Time // The endpoints used in this HeatMap calculation. Endpoints []*HeatMapEndpoint // The beginning of the time window for this HeatMap, inclusive. StartTime *time.Time // The traffic flows produced in this HeatMap calculation. TrafficFlows []*TrafficFlow }
HeatMapProperties - Class representing a Traffic Manager HeatMap properties.
func (HeatMapProperties) MarshalJSON ¶
func (h HeatMapProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type HeatMapProperties.
func (*HeatMapProperties) UnmarshalJSON ¶
func (h *HeatMapProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type HeatMapProperties.
type MonitorConfig ¶
type MonitorConfig struct { // List of custom headers. CustomHeaders []*MonitorConfigCustomHeadersItem // List of expected status code ranges. ExpectedStatusCodeRanges []*MonitorConfigExpectedStatusCodeRangesItem // The monitor interval for endpoints in this profile. This is the interval at which Traffic Manager will check the health // of each endpoint in this profile. IntervalInSeconds *int64 // The path relative to the endpoint domain name used to probe for endpoint health. Path *string // The TCP port used to probe for endpoint health. Port *int64 // The profile-level monitoring status of the Traffic Manager profile. ProfileMonitorStatus *ProfileMonitorStatus // The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health. Protocol *MonitorProtocol // The monitor timeout for endpoints in this profile. This is the time that Traffic Manager allows endpoints in this profile // to response to the health check. TimeoutInSeconds *int64 // The number of consecutive failed health check that Traffic Manager tolerates before declaring an endpoint in this profile // Degraded after the next failed health check. ToleratedNumberOfFailures *int64 }
MonitorConfig - Class containing endpoint monitoring settings in a Traffic Manager profile.
func (MonitorConfig) MarshalJSON ¶
func (m MonitorConfig) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MonitorConfig.
func (*MonitorConfig) UnmarshalJSON ¶ added in v1.1.0
func (m *MonitorConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MonitorConfig.
type MonitorConfigCustomHeadersItem ¶
type MonitorConfigCustomHeadersItem struct { // Header name. Name *string // Header value. Value *string }
MonitorConfigCustomHeadersItem - Custom header name and value.
func (MonitorConfigCustomHeadersItem) MarshalJSON ¶ added in v1.1.0
func (m MonitorConfigCustomHeadersItem) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MonitorConfigCustomHeadersItem.
func (*MonitorConfigCustomHeadersItem) UnmarshalJSON ¶ added in v1.1.0
func (m *MonitorConfigCustomHeadersItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MonitorConfigCustomHeadersItem.
type MonitorConfigExpectedStatusCodeRangesItem ¶
type MonitorConfigExpectedStatusCodeRangesItem struct { // Max status code. Max *int32 // Min status code. Min *int32 }
MonitorConfigExpectedStatusCodeRangesItem - Min and max value of a status code range.
func (MonitorConfigExpectedStatusCodeRangesItem) MarshalJSON ¶ added in v1.1.0
func (m MonitorConfigExpectedStatusCodeRangesItem) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MonitorConfigExpectedStatusCodeRangesItem.
func (*MonitorConfigExpectedStatusCodeRangesItem) UnmarshalJSON ¶ added in v1.1.0
func (m *MonitorConfigExpectedStatusCodeRangesItem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MonitorConfigExpectedStatusCodeRangesItem.
type MonitorProtocol ¶
type MonitorProtocol string
MonitorProtocol - The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health.
const ( MonitorProtocolHTTP MonitorProtocol = "HTTP" MonitorProtocolHTTPS MonitorProtocol = "HTTPS" MonitorProtocolTCP MonitorProtocol = "TCP" )
func PossibleMonitorProtocolValues ¶
func PossibleMonitorProtocolValues() []MonitorProtocol
PossibleMonitorProtocolValues returns the possible values for the MonitorProtocol const type.
type NameAvailability ¶ added in v0.2.0
type NameAvailability struct { // Descriptive message that explains why the name is not available, when applicable. Message *string // The relative name. Name *string // Describes whether the relative name is available or not. NameAvailable *bool // The reason why the name is not available, when applicable. Reason *string // Traffic Manager profile resource type. Type *string }
NameAvailability - Class representing a Traffic Manager Name Availability response.
func (NameAvailability) MarshalJSON ¶ added in v1.1.0
func (n NameAvailability) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type NameAvailability.
func (*NameAvailability) UnmarshalJSON ¶ added in v1.1.0
func (n *NameAvailability) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type NameAvailability.
type Profile ¶
type Profile struct { // Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string // The Azure Region where the resource lives Location *string // The name of the resource Name *string // The properties of the Traffic Manager profile. Properties *ProfileProperties // Resource tags. Tags map[string]*string // The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles. Type *string }
Profile - Class representing a Traffic Manager profile.
func (Profile) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Profile.
func (*Profile) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Profile.
type ProfileListResult ¶
type ProfileListResult struct { // Gets the list of Traffic manager profiles. Value []*Profile }
ProfileListResult - The list Traffic Manager profiles operation response.
func (ProfileListResult) MarshalJSON ¶
func (p ProfileListResult) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfileListResult.
func (*ProfileListResult) UnmarshalJSON ¶ added in v1.1.0
func (p *ProfileListResult) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfileListResult.
type ProfileMonitorStatus ¶
type ProfileMonitorStatus string
ProfileMonitorStatus - The profile-level monitoring status of the Traffic Manager profile.
const ( ProfileMonitorStatusCheckingEndpoints ProfileMonitorStatus = "CheckingEndpoints" ProfileMonitorStatusDegraded ProfileMonitorStatus = "Degraded" ProfileMonitorStatusDisabled ProfileMonitorStatus = "Disabled" ProfileMonitorStatusInactive ProfileMonitorStatus = "Inactive" ProfileMonitorStatusOnline ProfileMonitorStatus = "Online" )
func PossibleProfileMonitorStatusValues ¶
func PossibleProfileMonitorStatusValues() []ProfileMonitorStatus
PossibleProfileMonitorStatusValues returns the possible values for the ProfileMonitorStatus const type.
type ProfileProperties ¶
type ProfileProperties struct { // The list of allowed endpoint record types. AllowedEndpointRecordTypes []*AllowedEndpointRecordType // The DNS settings of the Traffic Manager profile. DNSConfig *DNSConfig // The list of endpoints in the Traffic Manager profile. Endpoints []*Endpoint // Maximum number of endpoints to be returned for MultiValue routing type. MaxReturn *int64 // The endpoint monitoring settings of the Traffic Manager profile. MonitorConfig *MonitorConfig // The status of the Traffic Manager profile. ProfileStatus *ProfileStatus // The traffic routing method of the Traffic Manager profile. TrafficRoutingMethod *TrafficRoutingMethod // Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, indicates 'Disabled'. // Enabling this feature will increase the cost of the Traffic Manage profile. TrafficViewEnrollmentStatus *TrafficViewEnrollmentStatus }
ProfileProperties - Class representing the Traffic Manager profile properties.
func (ProfileProperties) MarshalJSON ¶
func (p ProfileProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProfileProperties.
func (*ProfileProperties) UnmarshalJSON ¶ added in v1.1.0
func (p *ProfileProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProfileProperties.
type ProfileStatus ¶
type ProfileStatus string
ProfileStatus - The status of the Traffic Manager profile.
const ( ProfileStatusDisabled ProfileStatus = "Disabled" ProfileStatusEnabled ProfileStatus = "Enabled" )
func PossibleProfileStatusValues ¶
func PossibleProfileStatusValues() []ProfileStatus
PossibleProfileStatusValues returns the possible values for the ProfileStatus const type.
type ProfilesClient ¶
type ProfilesClient struct {
// contains filtered or unexported fields
}
ProfilesClient contains the methods for the Profiles group. Don't use this type directly, use NewProfilesClient() instead.
func NewProfilesClient ¶
func NewProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProfilesClient, error)
NewProfilesClient creates a new instance of ProfilesClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ProfilesClient) CheckTrafficManagerNameAvailabilityV2 ¶ added in v1.2.0
func (client *ProfilesClient) CheckTrafficManagerNameAvailabilityV2(ctx context.Context, parameters CheckTrafficManagerRelativeDNSNameAvailabilityParameters, options *ProfilesClientCheckTrafficManagerNameAvailabilityV2Options) (ProfilesClientCheckTrafficManagerNameAvailabilityV2Response, error)
CheckTrafficManagerNameAvailabilityV2 - Checks the availability of a Traffic Manager Relative DNS name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- parameters - The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation.
- options - ProfilesClientCheckTrafficManagerNameAvailabilityV2Options contains the optional parameters for the ProfilesClient.CheckTrafficManagerNameAvailabilityV2 method.
Example (NameAvailabilityV2TestNameAvailablePost21) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/NameAvailabilityV2Test_NameAvailable-POST-example-21.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().CheckTrafficManagerNameAvailabilityV2(ctx, armtrafficmanager.CheckTrafficManagerRelativeDNSNameAvailabilityParameters{ Name: to.Ptr("azsmnet5403"), Type: to.Ptr("microsoft.network/trafficmanagerprofiles"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NameAvailability = armtrafficmanager.NameAvailability{ // Name: to.Ptr("azsmnet5403"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // NameAvailable: to.Ptr(true), // } }
Output:
Example (NameAvailabilityV2TestNameNotAvailablePost23) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/NameAvailabilityV2Test_NameNotAvailable-POST-example-23.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().CheckTrafficManagerNameAvailabilityV2(ctx, armtrafficmanager.CheckTrafficManagerRelativeDNSNameAvailabilityParameters{ Name: to.Ptr("azsmnet4696"), Type: to.Ptr("microsoft.network/trafficmanagerprofiles"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NameAvailability = armtrafficmanager.NameAvailability{ // Name: to.Ptr("azsmnet4696"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // Message: to.Ptr("Domain name azsmnet4696.tmpreview.watmtest.azure-test.net already exists. Please choose a different DNS prefix."), // NameAvailable: to.Ptr(false), // Reason: to.Ptr("AlreadyExists"), // } }
Output:
func (*ProfilesClient) CheckTrafficManagerRelativeDNSNameAvailability ¶
func (client *ProfilesClient) CheckTrafficManagerRelativeDNSNameAvailability(ctx context.Context, parameters CheckTrafficManagerRelativeDNSNameAvailabilityParameters, options *ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions) (ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityResponse, error)
CheckTrafficManagerRelativeDNSNameAvailability - Checks the availability of a Traffic Manager Relative DNS name. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- parameters - The Traffic Manager name parameters supplied to the CheckTrafficManagerNameAvailability operation.
- options - ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions contains the optional parameters for the ProfilesClient.CheckTrafficManagerRelativeDNSNameAvailability method.
Example (NameAvailabilityTestNameAvailablePost21) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/NameAvailabilityTest_NameAvailable-POST-example-21.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().CheckTrafficManagerRelativeDNSNameAvailability(ctx, armtrafficmanager.CheckTrafficManagerRelativeDNSNameAvailabilityParameters{ Name: to.Ptr("azsmnet5403"), Type: to.Ptr("microsoft.network/trafficmanagerprofiles"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NameAvailability = armtrafficmanager.NameAvailability{ // Name: to.Ptr("azsmnet5403"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // NameAvailable: to.Ptr(true), // } }
Output:
Example (NameAvailabilityTestNameNotAvailablePost23) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/NameAvailabilityTest_NameNotAvailable-POST-example-23.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().CheckTrafficManagerRelativeDNSNameAvailability(ctx, armtrafficmanager.CheckTrafficManagerRelativeDNSNameAvailabilityParameters{ Name: to.Ptr("azsmnet4696"), Type: to.Ptr("microsoft.network/trafficmanagerprofiles"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.NameAvailability = armtrafficmanager.NameAvailability{ // Name: to.Ptr("azsmnet4696"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // Message: to.Ptr("Domain name azsmnet4696.tmpreview.watmtest.azure-test.net already exists. Please choose a different DNS prefix."), // NameAvailable: to.Ptr(false), // Reason: to.Ptr("AlreadyExists"), // } }
Output:
func (*ProfilesClient) CreateOrUpdate ¶
func (client *ProfilesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, parameters Profile, options *ProfilesClientCreateOrUpdateOptions) (ProfilesClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update a Traffic Manager profile. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- profileName - The name of the Traffic Manager profile.
- parameters - The Traffic Manager profile parameters supplied to the CreateOrUpdate operation.
- options - ProfilesClientCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.CreateOrUpdate method.
Example (ProfilePutMultiValue) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-PUT-MultiValue.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.Profile{ Location: to.Ptr("global"), Properties: &armtrafficmanager.ProfileProperties{ DNSConfig: &armtrafficmanager.DNSConfig{ RelativeName: to.Ptr("azsmnet6386"), TTL: to.Ptr[int64](35), }, MaxReturn: to.Ptr[int64](2), MonitorConfig: &armtrafficmanager.MonitorConfig{ Path: to.Ptr("/testpath.aspx"), Port: to.Ptr[int64](80), Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), }, ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodMultiValue), TrafficViewEnrollmentStatus: to.Ptr(armtrafficmanager.TrafficViewEnrollmentStatusDisabled), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Profile = armtrafficmanager.Profile{ // Name: to.Ptr("azsmnet6386"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386"), // Location: to.Ptr("global"), // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azsmnet6386.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azsmnet6386"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // }, // MaxReturn: to.Ptr[int64](2), // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // IntervalInSeconds: to.Ptr[int64](30), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusInactive), // TimeoutInSeconds: to.Ptr[int64](10), // ToleratedNumberOfFailures: to.Ptr[int64](3), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodMultiValue), // TrafficViewEnrollmentStatus: to.Ptr(armtrafficmanager.TrafficViewEnrollmentStatusDisabled), // }, // } }
Output:
Example (ProfilePutNoEndpoints) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-PUT-NoEndpoints.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager1421", "azsmnet6386", armtrafficmanager.Profile{ Location: to.Ptr("global"), Properties: &armtrafficmanager.ProfileProperties{ DNSConfig: &armtrafficmanager.DNSConfig{ RelativeName: to.Ptr("azsmnet6386"), TTL: to.Ptr[int64](35), }, MonitorConfig: &armtrafficmanager.MonitorConfig{ Path: to.Ptr("/testpath.aspx"), Port: to.Ptr[int64](80), Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), }, ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Profile = armtrafficmanager.Profile{ // Name: to.Ptr("azsmnet6386"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1421/providers/Microsoft.Network/trafficManagerProfiles/azsmnet6386"), // Location: to.Ptr("global"), // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azsmnet6386.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azsmnet6386"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // }, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // IntervalInSeconds: to.Ptr[int64](30), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusInactive), // TimeoutInSeconds: to.Ptr[int64](10), // ToleratedNumberOfFailures: to.Ptr[int64](3), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // }, // } }
Output:
Example (ProfilePutWithAliasing) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-PUT-WithAliasing.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2583", "azuresdkfornetautoresttrafficmanager6192", armtrafficmanager.Profile{ Location: to.Ptr("global"), Properties: &armtrafficmanager.ProfileProperties{ AllowedEndpointRecordTypes: []*armtrafficmanager.AllowedEndpointRecordType{ to.Ptr(armtrafficmanager.AllowedEndpointRecordTypeDomainName)}, DNSConfig: &armtrafficmanager.DNSConfig{ RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager6192"), TTL: to.Ptr[int64](35), }, Endpoints: []*armtrafficmanager.Endpoint{ { Name: to.Ptr("My external endpoint"), Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"), Properties: &armtrafficmanager.EndpointProperties{ EndpointLocation: to.Ptr("North Europe"), EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), Target: to.Ptr("foobar.contoso.com"), }, }}, MonitorConfig: &armtrafficmanager.MonitorConfig{ Path: to.Ptr("/testpath.aspx"), IntervalInSeconds: to.Ptr[int64](10), Port: to.Ptr[int64](80), TimeoutInSeconds: to.Ptr[int64](5), ToleratedNumberOfFailures: to.Ptr[int64](2), Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), }, ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Profile = armtrafficmanager.Profile{ // Name: to.Ptr("azuresdkfornetautoresttrafficmanager6192"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2583/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager6192"), // Location: to.Ptr("global"), // Properties: &armtrafficmanager.ProfileProperties{ // AllowedEndpointRecordTypes: []*armtrafficmanager.AllowedEndpointRecordType{ // to.Ptr(armtrafficmanager.AllowedEndpointRecordTypeDomainName)}, // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager6192.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager6192"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2583/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager6192/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // CustomHeaders: []*armtrafficmanager.EndpointPropertiesCustomHeadersItem{ // { // Name: to.Ptr("header-2"), // Value: to.Ptr("value-2-overridden"), // }}, // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // CustomHeaders: []*armtrafficmanager.MonitorConfigCustomHeadersItem{ // { // Name: to.Ptr("header-1"), // Value: to.Ptr("value-1"), // }, // { // Name: to.Ptr("header-2"), // Value: to.Ptr("value-2"), // }}, // IntervalInSeconds: to.Ptr[int64](10), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusCheckingEndpoints), // TimeoutInSeconds: to.Ptr[int64](5), // ToleratedNumberOfFailures: to.Ptr[int64](2), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // }, // } }
Output:
Example (ProfilePutWithCustomHeaders) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-PUT-WithCustomHeaders.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2583", "azuresdkfornetautoresttrafficmanager6192", armtrafficmanager.Profile{ Location: to.Ptr("global"), Properties: &armtrafficmanager.ProfileProperties{ DNSConfig: &armtrafficmanager.DNSConfig{ RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager6192"), TTL: to.Ptr[int64](35), }, Endpoints: []*armtrafficmanager.Endpoint{ { Name: to.Ptr("My external endpoint"), Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"), Properties: &armtrafficmanager.EndpointProperties{ CustomHeaders: []*armtrafficmanager.EndpointPropertiesCustomHeadersItem{ { Name: to.Ptr("header-2"), Value: to.Ptr("value-2-overridden"), }}, EndpointLocation: to.Ptr("North Europe"), EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), Target: to.Ptr("foobar.contoso.com"), }, }}, MonitorConfig: &armtrafficmanager.MonitorConfig{ Path: to.Ptr("/testpath.aspx"), CustomHeaders: []*armtrafficmanager.MonitorConfigCustomHeadersItem{ { Name: to.Ptr("header-1"), Value: to.Ptr("value-1"), }, { Name: to.Ptr("header-2"), Value: to.Ptr("value-2"), }}, ExpectedStatusCodeRanges: []*armtrafficmanager.MonitorConfigExpectedStatusCodeRangesItem{ { Max: to.Ptr[int32](205), Min: to.Ptr[int32](200), }, { Max: to.Ptr[int32](410), Min: to.Ptr[int32](400), }}, IntervalInSeconds: to.Ptr[int64](10), Port: to.Ptr[int64](80), TimeoutInSeconds: to.Ptr[int64](5), ToleratedNumberOfFailures: to.Ptr[int64](2), Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), }, ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), TrafficViewEnrollmentStatus: to.Ptr(armtrafficmanager.TrafficViewEnrollmentStatusDisabled), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Profile = armtrafficmanager.Profile{ // Name: to.Ptr("azuresdkfornetautoresttrafficmanager6192"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2583/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager6192"), // Location: to.Ptr("global"), // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager6192.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager6192"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2583/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager6192/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // CustomHeaders: []*armtrafficmanager.EndpointPropertiesCustomHeadersItem{ // { // Name: to.Ptr("header-2"), // Value: to.Ptr("value-2-overridden"), // }}, // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // CustomHeaders: []*armtrafficmanager.MonitorConfigCustomHeadersItem{ // { // Name: to.Ptr("header-1"), // Value: to.Ptr("value-1"), // }, // { // Name: to.Ptr("header-2"), // Value: to.Ptr("value-2"), // }}, // IntervalInSeconds: to.Ptr[int64](10), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusCheckingEndpoints), // TimeoutInSeconds: to.Ptr[int64](5), // ToleratedNumberOfFailures: to.Ptr[int64](2), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // TrafficViewEnrollmentStatus: to.Ptr(armtrafficmanager.TrafficViewEnrollmentStatusDisabled), // }, // } }
Output:
Example (ProfilePutWithEndpoints) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-PUT-WithEndpoints.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().CreateOrUpdate(ctx, "azuresdkfornetautoresttrafficmanager2583", "azuresdkfornetautoresttrafficmanager6192", armtrafficmanager.Profile{ Location: to.Ptr("global"), Properties: &armtrafficmanager.ProfileProperties{ DNSConfig: &armtrafficmanager.DNSConfig{ RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager6192"), TTL: to.Ptr[int64](35), }, Endpoints: []*armtrafficmanager.Endpoint{ { Name: to.Ptr("My external endpoint"), Type: to.Ptr("Microsoft.network/TrafficManagerProfiles/ExternalEndpoints"), Properties: &armtrafficmanager.EndpointProperties{ EndpointLocation: to.Ptr("North Europe"), EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), Target: to.Ptr("foobar.contoso.com"), }, }}, MonitorConfig: &armtrafficmanager.MonitorConfig{ Path: to.Ptr("/testpath.aspx"), IntervalInSeconds: to.Ptr[int64](10), Port: to.Ptr[int64](80), TimeoutInSeconds: to.Ptr[int64](5), ToleratedNumberOfFailures: to.Ptr[int64](2), Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), }, ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Profile = armtrafficmanager.Profile{ // Name: to.Ptr("azuresdkfornetautoresttrafficmanager6192"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2583/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager6192"), // Location: to.Ptr("global"), // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager6192.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager6192"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2583/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager6192/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // IntervalInSeconds: to.Ptr[int64](10), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusCheckingEndpoints), // TimeoutInSeconds: to.Ptr[int64](5), // ToleratedNumberOfFailures: to.Ptr[int64](2), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // }, // } }
Output:
Example (ProfilePutWithNestedEndpoints) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-PUT-WithNestedEndpoints.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().CreateOrUpdate(ctx, "myresourcegroup", "parentprofile", armtrafficmanager.Profile{ Location: to.Ptr("global"), Properties: &armtrafficmanager.ProfileProperties{ DNSConfig: &armtrafficmanager.DNSConfig{ RelativeName: to.Ptr("parentprofile"), TTL: to.Ptr[int64](35), }, Endpoints: []*armtrafficmanager.Endpoint{ { Name: to.Ptr("MyFirstNestedEndpoint"), Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/nestedEndpoints"), Properties: &armtrafficmanager.EndpointProperties{ EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), MinChildEndpoints: to.Ptr[int64](2), MinChildEndpointsIPv4: to.Ptr[int64](1), MinChildEndpointsIPv6: to.Ptr[int64](2), Priority: to.Ptr[int64](1), Target: to.Ptr("firstnestedprofile.tmpreview.watmtest.azure-test.net"), Weight: to.Ptr[int64](1), }, }, { Name: to.Ptr("MySecondNestedEndpoint"), Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/nestedEndpoints"), Properties: &armtrafficmanager.EndpointProperties{ EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), MinChildEndpoints: to.Ptr[int64](2), MinChildEndpointsIPv4: to.Ptr[int64](2), MinChildEndpointsIPv6: to.Ptr[int64](1), Priority: to.Ptr[int64](2), Target: to.Ptr("secondnestedprofile.tmpreview.watmtest.azure-test.net"), Weight: to.Ptr[int64](1), }, }}, MonitorConfig: &armtrafficmanager.MonitorConfig{ Path: to.Ptr("/testpath.aspx"), IntervalInSeconds: to.Ptr[int64](10), Port: to.Ptr[int64](80), TimeoutInSeconds: to.Ptr[int64](5), ToleratedNumberOfFailures: to.Ptr[int64](2), Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), }, ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPriority), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Profile = armtrafficmanager.Profile{ // Name: to.Ptr("parentprofile"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myresourcegroup/providers/Microsoft.Network/trafficManagerProfiles/parentprofile"), // Location: to.Ptr("global"), // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("parentprofile.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("parentprofile"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("MyFirstNestedEndpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/nestedEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myresourcegroup/providers/Microsoft.Network/trafficManagerProfiles/parentprofile/nestedEndpoints/MyFirstNestedEndpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // MinChildEndpoints: to.Ptr[int64](2), // MinChildEndpointsIPv4: to.Ptr[int64](1), // MinChildEndpointsIPv6: to.Ptr[int64](2), // Priority: to.Ptr[int64](1), // Target: to.Ptr("firstnestedprofile.tmpreview.watmtest.azure-test.net"), // Weight: to.Ptr[int64](1), // }, // }, // { // Name: to.Ptr("MySecondNestedEndpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/nestedEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/myresourcegroup/providers/Microsoft.Network/trafficManagerProfiles/parentprofile/nestedEndpoints/MySecondNestedEndpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // MinChildEndpoints: to.Ptr[int64](2), // MinChildEndpointsIPv4: to.Ptr[int64](2), // MinChildEndpointsIPv6: to.Ptr[int64](1), // Priority: to.Ptr[int64](1), // Target: to.Ptr("secondnestedprofile.tmpreview.watmtest.azure-test.net"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // IntervalInSeconds: to.Ptr[int64](10), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusCheckingEndpoints), // TimeoutInSeconds: to.Ptr[int64](5), // ToleratedNumberOfFailures: to.Ptr[int64](2), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPriority), // }, // } }
Output:
func (*ProfilesClient) Delete ¶
func (client *ProfilesClient) Delete(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientDeleteOptions) (ProfilesClientDeleteResponse, error)
Delete - Deletes a Traffic Manager profile. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- profileName - The name of the Traffic Manager profile to be deleted.
- options - ProfilesClientDeleteOptions contains the optional parameters for the ProfilesClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-DELETE.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().Delete(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DeleteOperationResult = armtrafficmanager.DeleteOperationResult{ // } }
Output:
func (*ProfilesClient) Get ¶
func (client *ProfilesClient) Get(ctx context.Context, resourceGroupName string, profileName string, options *ProfilesClientGetOptions) (ProfilesClientGetResponse, error)
Get - Gets a Traffic Manager profile. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- profileName - The name of the Traffic Manager profile.
- options - ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method.
Example (ProfileGetWithEndpoints) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-WithEndpoints.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Profile = armtrafficmanager.Profile{ // Name: to.Ptr("azuresdkfornetautoresttrafficmanager3880"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // }, // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager3880.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager3880"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // IntervalInSeconds: to.Ptr[int64](30), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusCheckingEndpoints), // TimeoutInSeconds: to.Ptr[int64](10), // ToleratedNumberOfFailures: to.Ptr[int64](3), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // }, // } }
Output:
Example (ProfileGetWithTrafficViewDisabled) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-WithTrafficViewDisabled.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Profile = armtrafficmanager.Profile{ // Name: to.Ptr("azuresdkfornetautoresttrafficmanager3880"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // }, // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager3880.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager3880"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // IntervalInSeconds: to.Ptr[int64](30), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusCheckingEndpoints), // TimeoutInSeconds: to.Ptr[int64](10), // ToleratedNumberOfFailures: to.Ptr[int64](3), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // TrafficViewEnrollmentStatus: to.Ptr(armtrafficmanager.TrafficViewEnrollmentStatusDisabled), // }, // } }
Output:
Example (ProfileGetWithTrafficViewEnabled) ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-WithTrafficViewEnabled.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().Get(ctx, "azuresdkfornetautoresttrafficmanager1323", "azuresdkfornetautoresttrafficmanager3880", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Profile = armtrafficmanager.Profile{ // Name: to.Ptr("azuresdkfornetautoresttrafficmanager3880"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // }, // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager3880.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager3880"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager1323/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3880/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // IntervalInSeconds: to.Ptr[int64](30), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusCheckingEndpoints), // TimeoutInSeconds: to.Ptr[int64](10), // ToleratedNumberOfFailures: to.Ptr[int64](3), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // TrafficViewEnrollmentStatus: to.Ptr(armtrafficmanager.TrafficViewEnrollmentStatusEnabled), // }, // } }
Output:
func (*ProfilesClient) NewListByResourceGroupPager ¶ added in v0.4.0
func (client *ProfilesClient) NewListByResourceGroupPager(resourceGroupName string, options *ProfilesClientListByResourceGroupOptions) *runtime.Pager[ProfilesClientListByResourceGroupResponse]
NewListByResourceGroupPager - Lists all Traffic Manager profiles within a resource group.
Generated from API version 2022-04-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- options - ProfilesClientListByResourceGroupOptions contains the optional parameters for the ProfilesClient.NewListByResourceGroupPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-ByResourceGroup.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewProfilesClient().NewListByResourceGroupPager("azuresdkfornetautoresttrafficmanager3640", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ProfileListResult = armtrafficmanager.ProfileListResult{ // Value: []*armtrafficmanager.Profile{ // { // Name: to.Ptr("azuresdkfornetautoresttrafficmanager1005"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager3640/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager1005"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // }, // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager1005.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager1005"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager3640/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager1005/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // IntervalInSeconds: to.Ptr[int64](30), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusOnline), // TimeoutInSeconds: to.Ptr[int64](10), // ToleratedNumberOfFailures: to.Ptr[int64](3), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // }, // }, // { // Name: to.Ptr("azuresdkfornetautoresttrafficmanager959"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager3640/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager959"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // }, // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager959.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager959"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager3640/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager959/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusOnline), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // IntervalInSeconds: to.Ptr[int64](30), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusOnline), // TimeoutInSeconds: to.Ptr[int64](10), // ToleratedNumberOfFailures: to.Ptr[int64](3), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // }, // }}, // } } }
Output:
func (*ProfilesClient) NewListBySubscriptionPager ¶ added in v0.4.0
func (client *ProfilesClient) NewListBySubscriptionPager(options *ProfilesClientListBySubscriptionOptions) *runtime.Pager[ProfilesClientListBySubscriptionResponse]
NewListBySubscriptionPager - Lists all Traffic Manager profiles within a subscription.
Generated from API version 2022-04-01
- options - ProfilesClientListBySubscriptionOptions contains the optional parameters for the ProfilesClient.NewListBySubscriptionPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-GET-BySubscription.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewProfilesClient().NewListBySubscriptionPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { log.Fatalf("failed to advance page: %v", err) } for _, v := range page.Value { // You could use page here. We use blank identifier for just demo purposes. _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // page.ProfileListResult = armtrafficmanager.ProfileListResult{ // Value: []*armtrafficmanager.Profile{ // { // Name: to.Ptr("azsmnet5183"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azsmnet1719/providers/Microsoft.Network/trafficManagerProfiles/azsmnet5183"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // }, // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azsmnet4696.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azsmnet4696"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // }, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // IntervalInSeconds: to.Ptr[int64](30), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusOnline), // TimeoutInSeconds: to.Ptr[int64](10), // ToleratedNumberOfFailures: to.Ptr[int64](3), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // }, // }, // { // Name: to.Ptr("azuresdkfornetautoresttrafficmanager3440"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager5168/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3440"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // }, // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager3440.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager3440"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager5168/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager3440/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusOnline), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // IntervalInSeconds: to.Ptr[int64](30), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusOnline), // TimeoutInSeconds: to.Ptr[int64](10), // ToleratedNumberOfFailures: to.Ptr[int64](3), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // }, // }, // { // Name: to.Ptr("onesdk8819"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/onesdk9785/providers/Microsoft.Network/trafficManagerProfiles/onesdk8819"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // }, // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("onesdk7242.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("onesdk7242"), // TTL: to.Ptr[int64](51), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("MyNestedEndpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/nestedEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/onesdk9785/providers/Microsoft.Network/trafficManagerProfiles/onesdk8819/nestedEndpoints/MyNestedEndpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("West Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusStopped), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // MinChildEndpoints: to.Ptr[int64](1), // Priority: to.Ptr[int64](1), // Target: to.Ptr("onesdk4285.tmpreview.watmtest.azure-test.net"), // TargetResourceID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/onesdk9785/providers/Microsoft.Network/trafficManagerProfiles/onesdk1792"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testparent.asp"), // IntervalInSeconds: to.Ptr[int64](30), // Port: to.Ptr[int64](111), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusOnline), // TimeoutInSeconds: to.Ptr[int64](10), // ToleratedNumberOfFailures: to.Ptr[int64](3), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTPS), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // }, // }}, // } } }
Output:
func (*ProfilesClient) Update ¶
func (client *ProfilesClient) Update(ctx context.Context, resourceGroupName string, profileName string, parameters Profile, options *ProfilesClientUpdateOptions) (ProfilesClientUpdateResponse, error)
Update - Update a Traffic Manager profile. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- resourceGroupName - The name of the resource group. The name is case insensitive.
- profileName - The name of the Traffic Manager profile.
- parameters - The Traffic Manager profile parameters supplied to the Update operation.
- options - ProfilesClientUpdateOptions contains the optional parameters for the ProfilesClient.Update method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/Profile-PATCH-MonitorConfig.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewProfilesClient().Update(ctx, "azuresdkfornetautoresttrafficmanager2583", "azuresdkfornetautoresttrafficmanager6192", armtrafficmanager.Profile{ Properties: &armtrafficmanager.ProfileProperties{ MonitorConfig: &armtrafficmanager.MonitorConfig{ Path: to.Ptr("/testpath.aspx"), CustomHeaders: []*armtrafficmanager.MonitorConfigCustomHeadersItem{ { Name: to.Ptr("header-1"), Value: to.Ptr("value-1"), }, { Name: to.Ptr("header-2"), Value: to.Ptr("value-2"), }}, IntervalInSeconds: to.Ptr[int64](30), Port: to.Ptr[int64](80), TimeoutInSeconds: to.Ptr[int64](6), ToleratedNumberOfFailures: to.Ptr[int64](4), Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.Profile = armtrafficmanager.Profile{ // Name: to.Ptr("azuresdkfornetautoresttrafficmanager6192"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2583/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager6192"), // Location: to.Ptr("global"), // Tags: map[string]*string{ // }, // Properties: &armtrafficmanager.ProfileProperties{ // DNSConfig: &armtrafficmanager.DNSConfig{ // Fqdn: to.Ptr("azuresdkfornetautoresttrafficmanager6192.tmpreview.watmtest.azure-test.net"), // RelativeName: to.Ptr("azuresdkfornetautoresttrafficmanager6192"), // TTL: to.Ptr[int64](35), // }, // Endpoints: []*armtrafficmanager.Endpoint{ // { // Name: to.Ptr("My external endpoint"), // Type: to.Ptr("Microsoft.Network/trafficManagerProfiles/externalEndpoints"), // ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/azuresdkfornetautoresttrafficmanager2583/providers/Microsoft.Network/trafficManagerProfiles/azuresdkfornetautoresttrafficmanager6192/externalEndpoints/My external endpoint"), // Properties: &armtrafficmanager.EndpointProperties{ // EndpointLocation: to.Ptr("North Europe"), // EndpointMonitorStatus: to.Ptr(armtrafficmanager.EndpointMonitorStatusCheckingEndpoint), // EndpointStatus: to.Ptr(armtrafficmanager.EndpointStatusEnabled), // Priority: to.Ptr[int64](1), // Target: to.Ptr("foobar.contoso.com"), // Weight: to.Ptr[int64](1), // }, // }}, // MonitorConfig: &armtrafficmanager.MonitorConfig{ // Path: to.Ptr("/testpath.aspx"), // CustomHeaders: []*armtrafficmanager.MonitorConfigCustomHeadersItem{ // { // Name: to.Ptr("header-1"), // Value: to.Ptr("value-1"), // }, // { // Name: to.Ptr("header-2"), // Value: to.Ptr("value-2"), // }}, // IntervalInSeconds: to.Ptr[int64](30), // Port: to.Ptr[int64](80), // ProfileMonitorStatus: to.Ptr(armtrafficmanager.ProfileMonitorStatusCheckingEndpoints), // TimeoutInSeconds: to.Ptr[int64](6), // ToleratedNumberOfFailures: to.Ptr[int64](4), // Protocol: to.Ptr(armtrafficmanager.MonitorProtocolHTTP), // }, // ProfileStatus: to.Ptr(armtrafficmanager.ProfileStatusEnabled), // TrafficRoutingMethod: to.Ptr(armtrafficmanager.TrafficRoutingMethodPerformance), // }, // } }
Output:
type ProfilesClientCheckTrafficManagerNameAvailabilityV2Options ¶ added in v1.2.0
type ProfilesClientCheckTrafficManagerNameAvailabilityV2Options struct { }
ProfilesClientCheckTrafficManagerNameAvailabilityV2Options contains the optional parameters for the ProfilesClient.CheckTrafficManagerNameAvailabilityV2 method.
type ProfilesClientCheckTrafficManagerNameAvailabilityV2Response ¶ added in v1.2.0
type ProfilesClientCheckTrafficManagerNameAvailabilityV2Response struct { // Class representing a Traffic Manager Name Availability response. NameAvailability }
ProfilesClientCheckTrafficManagerNameAvailabilityV2Response contains the response from method ProfilesClient.CheckTrafficManagerNameAvailabilityV2.
type ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions ¶ added in v0.2.0
type ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions struct { }
ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityOptions contains the optional parameters for the ProfilesClient.CheckTrafficManagerRelativeDNSNameAvailability method.
type ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityResponse ¶ added in v0.2.0
type ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityResponse struct { // Class representing a Traffic Manager Name Availability response. NameAvailability }
ProfilesClientCheckTrafficManagerRelativeDNSNameAvailabilityResponse contains the response from method ProfilesClient.CheckTrafficManagerRelativeDNSNameAvailability.
type ProfilesClientCreateOrUpdateOptions ¶ added in v0.2.0
type ProfilesClientCreateOrUpdateOptions struct { }
ProfilesClientCreateOrUpdateOptions contains the optional parameters for the ProfilesClient.CreateOrUpdate method.
type ProfilesClientCreateOrUpdateResponse ¶ added in v0.2.0
type ProfilesClientCreateOrUpdateResponse struct { // Class representing a Traffic Manager profile. Profile }
ProfilesClientCreateOrUpdateResponse contains the response from method ProfilesClient.CreateOrUpdate.
type ProfilesClientDeleteOptions ¶ added in v0.2.0
type ProfilesClientDeleteOptions struct { }
ProfilesClientDeleteOptions contains the optional parameters for the ProfilesClient.Delete method.
type ProfilesClientDeleteResponse ¶ added in v0.2.0
type ProfilesClientDeleteResponse struct { // The result of the request or operation. DeleteOperationResult }
ProfilesClientDeleteResponse contains the response from method ProfilesClient.Delete.
type ProfilesClientGetOptions ¶ added in v0.2.0
type ProfilesClientGetOptions struct { }
ProfilesClientGetOptions contains the optional parameters for the ProfilesClient.Get method.
type ProfilesClientGetResponse ¶ added in v0.2.0
type ProfilesClientGetResponse struct { // Class representing a Traffic Manager profile. Profile }
ProfilesClientGetResponse contains the response from method ProfilesClient.Get.
type ProfilesClientListByResourceGroupOptions ¶ added in v0.2.0
type ProfilesClientListByResourceGroupOptions struct { }
ProfilesClientListByResourceGroupOptions contains the optional parameters for the ProfilesClient.NewListByResourceGroupPager method.
type ProfilesClientListByResourceGroupResponse ¶ added in v0.2.0
type ProfilesClientListByResourceGroupResponse struct { // The list Traffic Manager profiles operation response. ProfileListResult }
ProfilesClientListByResourceGroupResponse contains the response from method ProfilesClient.NewListByResourceGroupPager.
type ProfilesClientListBySubscriptionOptions ¶ added in v0.2.0
type ProfilesClientListBySubscriptionOptions struct { }
ProfilesClientListBySubscriptionOptions contains the optional parameters for the ProfilesClient.NewListBySubscriptionPager method.
type ProfilesClientListBySubscriptionResponse ¶ added in v0.2.0
type ProfilesClientListBySubscriptionResponse struct { // The list Traffic Manager profiles operation response. ProfileListResult }
ProfilesClientListBySubscriptionResponse contains the response from method ProfilesClient.NewListBySubscriptionPager.
type ProfilesClientUpdateOptions ¶ added in v0.2.0
type ProfilesClientUpdateOptions struct { }
ProfilesClientUpdateOptions contains the optional parameters for the ProfilesClient.Update method.
type ProfilesClientUpdateResponse ¶ added in v0.2.0
type ProfilesClientUpdateResponse struct { // Class representing a Traffic Manager profile. Profile }
ProfilesClientUpdateResponse contains the response from method ProfilesClient.Update.
type ProxyResource ¶
type ProxyResource struct { // Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string // The name of the resource Name *string // The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles. Type *string }
ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location and tags
func (ProxyResource) MarshalJSON ¶ added in v1.1.0
func (p ProxyResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProxyResource.
func (*ProxyResource) UnmarshalJSON ¶ added in v1.1.0
func (p *ProxyResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.
type QueryExperience ¶
type QueryExperience struct { // REQUIRED; The id of the endpoint from the 'endpoints' array which these queries were routed to. EndpointID *int32 // REQUIRED; The number of queries originating from this location. QueryCount *int32 // The latency experienced by queries originating from this location. Latency *float64 }
QueryExperience - Class representing a Traffic Manager HeatMap query experience properties.
func (QueryExperience) MarshalJSON ¶ added in v1.1.0
func (q QueryExperience) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type QueryExperience.
func (*QueryExperience) UnmarshalJSON ¶ added in v1.1.0
func (q *QueryExperience) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type QueryExperience.
type Region ¶
type Region struct { // The code of the region Code *string // The name of the region Name *string // The list of Regions grouped under this Region in the Geographic Hierarchy. Regions []*Region }
Region - Class representing a region in the Geographic hierarchy used with the Geographic traffic routing method.
func (Region) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Region.
func (*Region) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Region.
type Resource ¶
type Resource struct { // Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string // The name of the resource Name *string // The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles. Type *string }
Resource - The core properties of ARM resources
func (Resource) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
type TrackedResource ¶
type TrackedResource struct { // Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string // The Azure Region where the resource lives Location *string // The name of the resource Name *string // Resource tags. Tags map[string]*string // The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles. Type *string }
TrackedResource - The resource model definition for a ARM tracked top level resource
func (TrackedResource) MarshalJSON ¶
func (t TrackedResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TrackedResource.
func (*TrackedResource) UnmarshalJSON ¶ added in v1.1.0
func (t *TrackedResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource.
type TrafficFlow ¶
type TrafficFlow struct { // The approximate latitude that these queries originated from. Latitude *float64 // The approximate longitude that these queries originated from. Longitude *float64 // The query experiences produced in this HeatMap calculation. QueryExperiences []*QueryExperience // The IP address that this query experience originated from. SourceIP *string }
TrafficFlow - Class representing a Traffic Manager HeatMap traffic flow properties.
func (TrafficFlow) MarshalJSON ¶
func (t TrafficFlow) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type TrafficFlow.
func (*TrafficFlow) UnmarshalJSON ¶ added in v1.1.0
func (t *TrafficFlow) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type TrafficFlow.
type TrafficRoutingMethod ¶
type TrafficRoutingMethod string
TrafficRoutingMethod - The traffic routing method of the Traffic Manager profile.
const ( TrafficRoutingMethodGeographic TrafficRoutingMethod = "Geographic" TrafficRoutingMethodMultiValue TrafficRoutingMethod = "MultiValue" TrafficRoutingMethodPerformance TrafficRoutingMethod = "Performance" TrafficRoutingMethodPriority TrafficRoutingMethod = "Priority" TrafficRoutingMethodSubnet TrafficRoutingMethod = "Subnet" TrafficRoutingMethodWeighted TrafficRoutingMethod = "Weighted" )
func PossibleTrafficRoutingMethodValues ¶
func PossibleTrafficRoutingMethodValues() []TrafficRoutingMethod
PossibleTrafficRoutingMethodValues returns the possible values for the TrafficRoutingMethod const type.
type TrafficViewEnrollmentStatus ¶
type TrafficViewEnrollmentStatus string
TrafficViewEnrollmentStatus - Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, indicates 'Disabled'. Enabling this feature will increase the cost of the Traffic Manage profile.
const ( TrafficViewEnrollmentStatusDisabled TrafficViewEnrollmentStatus = "Disabled" TrafficViewEnrollmentStatusEnabled TrafficViewEnrollmentStatus = "Enabled" )
func PossibleTrafficViewEnrollmentStatusValues ¶
func PossibleTrafficViewEnrollmentStatusValues() []TrafficViewEnrollmentStatus
PossibleTrafficViewEnrollmentStatusValues returns the possible values for the TrafficViewEnrollmentStatus const type.
type UserMetricsKeysClient ¶ added in v0.2.0
type UserMetricsKeysClient struct {
// contains filtered or unexported fields
}
UserMetricsKeysClient contains the methods for the TrafficManagerUserMetricsKeys group. Don't use this type directly, use NewUserMetricsKeysClient() instead.
func NewUserMetricsKeysClient ¶ added in v0.2.0
func NewUserMetricsKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserMetricsKeysClient, error)
NewUserMetricsKeysClient creates a new instance of UserMetricsKeysClient with the specified values.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*UserMetricsKeysClient) CreateOrUpdate ¶ added in v0.2.0
func (client *UserMetricsKeysClient) CreateOrUpdate(ctx context.Context, options *UserMetricsKeysClientCreateOrUpdateOptions) (UserMetricsKeysClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update a subscription-level key used for Real User Metrics collection. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- options - UserMetricsKeysClientCreateOrUpdateOptions contains the optional parameters for the UserMetricsKeysClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/TrafficManagerUserMetricsKeys-PUT.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewUserMetricsKeysClient().CreateOrUpdate(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*UserMetricsKeysClient) Delete ¶ added in v0.2.0
func (client *UserMetricsKeysClient) Delete(ctx context.Context, options *UserMetricsKeysClientDeleteOptions) (UserMetricsKeysClientDeleteResponse, error)
Delete - Delete a subscription-level key used for Real User Metrics collection. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- options - UserMetricsKeysClientDeleteOptions contains the optional parameters for the UserMetricsKeysClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/TrafficManagerUserMetricsKeys-DELETE.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewUserMetricsKeysClient().Delete(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DeleteOperationResult = armtrafficmanager.DeleteOperationResult{ // } }
Output:
func (*UserMetricsKeysClient) Get ¶ added in v0.2.0
func (client *UserMetricsKeysClient) Get(ctx context.Context, options *UserMetricsKeysClientGetOptions) (UserMetricsKeysClientGetResponse, error)
Get - Get the subscription-level key used for Real User Metrics collection. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2022-04-01
- options - UserMetricsKeysClientGetOptions contains the optional parameters for the UserMetricsKeysClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/0d41e635294dce73dfa99b07f3da4b68a9c9e29c/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2022-04-01/examples/TrafficManagerUserMetricsKeys-GET.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/trafficmanager/armtrafficmanager" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armtrafficmanager.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewUserMetricsKeysClient().Get(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.UserMetricsModel = armtrafficmanager.UserMetricsModel{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.Network/trafficManagerUserMetricsKeys"), // ID: to.Ptr("/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default"), // Properties: &armtrafficmanager.UserMetricsProperties{ // Key: to.Ptr("9ea056eb38f145a0891b5d5dc15e9aa2"), // }, // } }
Output:
type UserMetricsKeysClientCreateOrUpdateOptions ¶ added in v0.2.0
type UserMetricsKeysClientCreateOrUpdateOptions struct { }
UserMetricsKeysClientCreateOrUpdateOptions contains the optional parameters for the UserMetricsKeysClient.CreateOrUpdate method.
type UserMetricsKeysClientCreateOrUpdateResponse ¶ added in v0.2.0
type UserMetricsKeysClientCreateOrUpdateResponse struct { // Class representing Traffic Manager User Metrics. UserMetricsModel }
UserMetricsKeysClientCreateOrUpdateResponse contains the response from method UserMetricsKeysClient.CreateOrUpdate.
type UserMetricsKeysClientDeleteOptions ¶ added in v0.2.0
type UserMetricsKeysClientDeleteOptions struct { }
UserMetricsKeysClientDeleteOptions contains the optional parameters for the UserMetricsKeysClient.Delete method.
type UserMetricsKeysClientDeleteResponse ¶ added in v0.2.0
type UserMetricsKeysClientDeleteResponse struct { // The result of the request or operation. DeleteOperationResult }
UserMetricsKeysClientDeleteResponse contains the response from method UserMetricsKeysClient.Delete.
type UserMetricsKeysClientGetOptions ¶ added in v0.2.0
type UserMetricsKeysClientGetOptions struct { }
UserMetricsKeysClientGetOptions contains the optional parameters for the UserMetricsKeysClient.Get method.
type UserMetricsKeysClientGetResponse ¶ added in v0.2.0
type UserMetricsKeysClientGetResponse struct { // Class representing Traffic Manager User Metrics. UserMetricsModel }
UserMetricsKeysClientGetResponse contains the response from method UserMetricsKeysClient.Get.
type UserMetricsModel ¶
type UserMetricsModel struct { // Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName} ID *string // The name of the resource Name *string // The properties of the Traffic Manager User Metrics. Properties *UserMetricsProperties // The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles. Type *string }
UserMetricsModel - Class representing Traffic Manager User Metrics.
func (UserMetricsModel) MarshalJSON ¶
func (u UserMetricsModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserMetricsModel.
func (*UserMetricsModel) UnmarshalJSON ¶ added in v1.1.0
func (u *UserMetricsModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserMetricsModel.
type UserMetricsProperties ¶
type UserMetricsProperties struct { // The key returned by the User Metrics operation. Key *string }
UserMetricsProperties - Class representing a Traffic Manager Real User Metrics key response.
func (UserMetricsProperties) MarshalJSON ¶ added in v1.1.0
func (u UserMetricsProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UserMetricsProperties.
func (*UserMetricsProperties) UnmarshalJSON ¶ added in v1.1.0
func (u *UserMetricsProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UserMetricsProperties.