[Automation] Collect examples from azure-sdk-for-go#sdk/resourcemanager/elastic/armelastic/v1.0.0

This commit is contained in:
Azure SDK Bot 2024-10-24 04:04:10 -07:00 коммит произвёл GitHub
Родитель bad8399e26
Коммит 9b37aafb98
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
74 изменённых файлов: 1597 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,51 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/AllTrafficFilters_list.json
func ExampleAllTrafficFiltersClient_List() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewAllTrafficFiltersClient().List(ctx, "myResourceGroup", "myMonitor", 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.TrafficFilterResponse = armelastic.TrafficFilterResponse{
// Rulesets: []*armelastic.TrafficFilter{
// {
// Name: to.Ptr("IPFromApi"),
// Type: to.Ptr(armelastic.TypeIP),
// Description: to.Ptr("created from azure"),
// ID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd"),
// IncludeByDefault: to.Ptr(false),
// Region: to.Ptr("azure-eastus"),
// Rules: []*armelastic.TrafficFilterRule{
// {
// Description: to.Ptr("Allow inbound traffic from IP address 192.168.131.0"),
// ID: to.Ptr("f0297dad72af4a5e964cddf817f35e65"),
// Source: to.Ptr("192.168.131.0"),
// },
// {
// Description: to.Ptr("Allow inbound traffic from IP address block 192.168.132.6/22"),
// ID: to.Ptr("f9c00169f0e54931ae72aabde326b589"),
// Source: to.Ptr("192.168.132.6/22"),
// }},
// }},
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,31 @@
package armelastic_test
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/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/AssociateTrafficFilter_Update.json
func ExampleAssociateTrafficFilterClient_BeginAssociate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAssociateTrafficFilterClient().BeginAssociate(ctx, "myResourceGroup", "myMonitor", &armelastic.AssociateTrafficFilterClientBeginAssociateOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,51 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/AssociatedFiltersForDeployment_list.json
func ExampleListAssociatedTrafficFiltersClient_List() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewListAssociatedTrafficFiltersClient().List(ctx, "myResourceGroup", "myMonitor", 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.TrafficFilterResponse = armelastic.TrafficFilterResponse{
// Rulesets: []*armelastic.TrafficFilter{
// {
// Name: to.Ptr("IPFromApi"),
// Type: to.Ptr(armelastic.TypeIP),
// Description: to.Ptr("created from azure"),
// ID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd"),
// IncludeByDefault: to.Ptr(false),
// Region: to.Ptr("azure-eastus"),
// Rules: []*armelastic.TrafficFilterRule{
// {
// Description: to.Ptr("Allow inbound traffic from IP address 192.168.131.0"),
// ID: to.Ptr("f0297dad72af4a5e964cddf817f35e65"),
// Source: to.Ptr("192.168.131.0"),
// },
// {
// Description: to.Ptr("Allow inbound traffic from IP address block 192.168.132.6/22"),
// ID: to.Ptr("f9c00169f0e54931ae72aabde326b589"),
// Source: to.Ptr("192.168.132.6/22"),
// }},
// }},
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,46 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/BillingInfo_Get.json
func ExampleBillingInfoClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewBillingInfoClient().Get(ctx, "myResourceGroup", "myMonitor", 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.BillingInfoResponse = armelastic.BillingInfoResponse{
// MarketplaceSaasInfo: &armelastic.MarketplaceSaaSInfo{
// BilledAzureSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// MarketplaceName: to.Ptr("MP_RESOURCE"),
// MarketplaceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.SaaS/resources/AzElastic_b1190c8f"),
// MarketplaceStatus: to.Ptr("Status"),
// MarketplaceSubscription: &armelastic.MarketplaceSaaSInfoMarketplaceSubscription{
// ID: to.Ptr("12345678-1234-1234-1234-123456789012"),
// },
// Subscribed: to.Ptr(true),
// },
// PartnerBillingEntity: &armelastic.PartnerBillingEntity{
// Name: to.Ptr("elasticOrganizationName"),
// ID: to.Ptr("1234567890"),
// PartnerEntityURI: to.Ptr("https://example.com"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,45 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/ConnectedPartnerResources_List.json
func ExampleConnectedPartnerResourcesClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewConnectedPartnerResourcesClient().NewListPager("myResourceGroup", "myMonitor", 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.ConnectedPartnerResourcesListResponse = armelastic.ConnectedPartnerResourcesListResponse{
// Value: []*armelastic.ConnectedPartnerResourcesListFormat{
// {
// Properties: &armelastic.ConnectedPartnerResourceProperties{
// AzureResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"),
// Location: to.Ptr("West US 2"),
// PartnerDeploymentName: to.Ptr("deploymentname"),
// PartnerDeploymentURI: to.Ptr("https://examplessourl.com"),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,45 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/DeploymentInfo_List.json
func ExampleDeploymentInfoClient_List() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewDeploymentInfoClient().List(ctx, "myResourceGroup", "myMonitor", 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.DeploymentInfoResponse = armelastic.DeploymentInfoResponse{
// DeploymentURL: to.Ptr("https://endpoint.eastus.kb.azure.elastic-cloud.com:9243"),
// DiskCapacity: to.Ptr("245760"),
// ElasticsearchEndPoint: to.Ptr("alias.es.eastus2.staging.azure.foundit.no"),
// MarketplaceSaasInfo: &armelastic.MarketplaceSaaSInfo{
// MarketplaceName: to.Ptr("MP_RESOURCE"),
// MarketplaceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.SaaS/resources/AzElastic_b1190c8f"),
// MarketplaceStatus: to.Ptr("Status"),
// MarketplaceSubscription: &armelastic.MarketplaceSaaSInfoMarketplaceSubscription{
// ID: to.Ptr("12345678-1234-1234-1234-123456789012"),
// },
// },
// MemoryCapacity: to.Ptr("1024"),
// Status: to.Ptr(armelastic.ElasticDeploymentStatusHealthy),
// Version: to.Ptr("7.9.3"),
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,27 @@
package armelastic_test
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/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/DetachAndDeleteTrafficFilter_Delete.json
func ExampleDetachAndDeleteTrafficFilterClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewDetachAndDeleteTrafficFilterClient().Delete(ctx, "myResourceGroup", "myMonitor", &armelastic.DetachAndDeleteTrafficFilterClientDeleteOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,31 @@
package armelastic_test
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/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/DetachTrafficFilters_Update.json
func ExampleDetachTrafficFilterClient_BeginUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewDetachTrafficFilterClient().BeginUpdate(ctx, "myResourceGroup", "myMonitor", &armelastic.DetachTrafficFilterClientBeginUpdateOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,42 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/ElasticVersions_List.json
func ExampleVersionsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewVersionsClient().NewListPager("myregion", 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.VersionsListResponse = armelastic.VersionsListResponse{
// Value: []*armelastic.VersionListFormat{
// {
// Properties: &armelastic.VersionListProperties{
// Version: to.Ptr("version1"),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,32 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/ExternalUserInfo.json
func ExampleExternalUserClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewExternalUserClient().CreateOrUpdate(ctx, "myResourceGroup", "myMonitor", &armelastic.ExternalUserClientCreateOrUpdateOptions{Body: 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.ExternalUserCreationResponse = armelastic.ExternalUserCreationResponse{
// Created: to.Ptr(true),
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
package armelastic_test
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/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/IPTrafficFilter_Create.json
func ExampleCreateAndAssociateIPFilterClient_BeginCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCreateAndAssociateIPFilterClient().BeginCreate(ctx, "myResourceGroup", "myMonitor", &armelastic.CreateAndAssociateIPFilterClientBeginCreateOptions{IPs: to.Ptr("192.168.131.0, 192.168.132.6/22"),
Name: nil,
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,30 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/Monitor_Upgrade.json
func ExampleMonitorClient_BeginUpgrade() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMonitorClient().BeginUpgrade(ctx, "myResourceGroup", "myMonitor", &armelastic.MonitorClientBeginUpgradeOptions{Body: nil})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,42 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/MonitoredResources_List.json
func ExampleMonitoredResourcesClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMonitoredResourcesClient().NewListPager("myResourceGroup", "myMonitor", 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.MonitoredResourceListResponse = armelastic.MonitoredResourceListResponse{
// Value: []*armelastic.MonitoredResource{
// {
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.KeyVault/vaults/myVault"),
// ReasonForLogsStatus: to.Ptr("CapturedByRules"),
// SendingLogs: to.Ptr(armelastic.SendingLogsTrue),
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,64 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/Monitors_Create.json
func ExampleMonitorsClient_BeginCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMonitorsClient().BeginCreate(ctx, "myResourceGroup", "myMonitor", &armelastic.MonitorsClientBeginCreateOptions{Body: nil})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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.MonitorResource = armelastic.MonitorResource{
// Name: to.Ptr("myMonitor"),
// Type: to.Ptr("Microsoft.Elastic/monitors"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"),
// Location: to.Ptr("West US 2"),
// Properties: &armelastic.MonitorProperties{
// ElasticProperties: &armelastic.Properties{
// ElasticCloudDeployment: &armelastic.CloudDeployment{
// Name: to.Ptr("deploymentname"),
// AzureSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// DeploymentID: to.Ptr("deployment_id"),
// ElasticsearchRegion: to.Ptr("azure-westus2"),
// ElasticsearchServiceURL: to.Ptr("https://elasticsearchendpoint.com"),
// KibanaServiceURL: to.Ptr("https://kibanaserviceurl.com"),
// KibanaSsoURL: to.Ptr("https://kibanssourl.com"),
// },
// ElasticCloudUser: &armelastic.CloudUser{
// ElasticCloudSsoDefaultURL: to.Ptr("https://examplessourl.com"),
// EmailAddress: to.Ptr("alice@microsoft.com"),
// ID: to.Ptr("myid123"),
// },
// },
// ProvisioningState: to.Ptr(armelastic.ProvisioningStateSucceeded),
// },
// SKU: &armelastic.ResourceSKU{
// Name: to.Ptr("free_Monthly"),
// },
// Tags: map[string]*string{
// "Environment": to.Ptr("Dev"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,30 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/Monitors_Delete.json
func ExampleMonitorsClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewMonitorsClient().BeginDelete(ctx, "myResourceGroup", "myMonitor", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,60 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/Monitors_Get.json
func ExampleMonitorsClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMonitorsClient().Get(ctx, "myResourceGroup", "myMonitor", 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.MonitorResource = armelastic.MonitorResource{
// Name: to.Ptr("myMonitor"),
// Type: to.Ptr("Microsoft.Elastic/monitors"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"),
// Location: to.Ptr("West US 2"),
// Properties: &armelastic.MonitorProperties{
// ElasticProperties: &armelastic.Properties{
// ElasticCloudDeployment: &armelastic.CloudDeployment{
// Name: to.Ptr("deploymentname"),
// AzureSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// DeploymentID: to.Ptr("deployment_id"),
// ElasticsearchRegion: to.Ptr("azure-westus2"),
// ElasticsearchServiceURL: to.Ptr("https://elasticsearchendpoint.com"),
// KibanaServiceURL: to.Ptr("https://kibanaserviceurl.com"),
// KibanaSsoURL: to.Ptr("https://kibanssourl.com"),
// },
// ElasticCloudUser: &armelastic.CloudUser{
// ElasticCloudSsoDefaultURL: to.Ptr("https://examplessourl.com"),
// EmailAddress: to.Ptr("alice@microsoft.com"),
// ID: to.Ptr("myid123"),
// },
// },
// LiftrResourceCategory: to.Ptr(armelastic.LiftrResourceCategoriesMonitorLogs),
// LiftrResourcePreference: to.Ptr[int32](0),
// MonitoringStatus: to.Ptr(armelastic.MonitoringStatusEnabled),
// ProvisioningState: to.Ptr(armelastic.ProvisioningStateSucceeded),
// },
// Tags: map[string]*string{
// "Environment": to.Ptr("Dev"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,68 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/Monitors_List.json
func ExampleMonitorsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMonitorsClient().NewListPager(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.MonitorResourceListResponse = armelastic.MonitorResourceListResponse{
// Value: []*armelastic.MonitorResource{
// {
// Name: to.Ptr("myMonitor"),
// Type: to.Ptr("Microsoft.Elastic/monitors"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"),
// Location: to.Ptr("West US 2"),
// Properties: &armelastic.MonitorProperties{
// ElasticProperties: &armelastic.Properties{
// ElasticCloudDeployment: &armelastic.CloudDeployment{
// Name: to.Ptr("deploymentname"),
// AzureSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// DeploymentID: to.Ptr("deployment_id"),
// ElasticsearchRegion: to.Ptr("azure-westus2"),
// ElasticsearchServiceURL: to.Ptr("https://elasticsearchendpoint.com"),
// KibanaServiceURL: to.Ptr("https://kibanaserviceurl.com"),
// KibanaSsoURL: to.Ptr("https://kibanssourl.com"),
// },
// ElasticCloudUser: &armelastic.CloudUser{
// ElasticCloudSsoDefaultURL: to.Ptr("https://examplessourl.com"),
// EmailAddress: to.Ptr("alice@microsoft.com"),
// ID: to.Ptr("myid123"),
// },
// },
// LiftrResourceCategory: to.Ptr(armelastic.LiftrResourceCategoriesMonitorLogs),
// LiftrResourcePreference: to.Ptr[int32](0),
// MonitoringStatus: to.Ptr(armelastic.MonitoringStatusEnabled),
// ProvisioningState: to.Ptr(armelastic.ProvisioningStateSucceeded),
// },
// Tags: map[string]*string{
// "Environment": to.Ptr("Dev"),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,68 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/Monitors_ListByResourceGroup.json
func ExampleMonitorsClient_NewListByResourceGroupPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewMonitorsClient().NewListByResourceGroupPager("myResourceGroup", 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.MonitorResourceListResponse = armelastic.MonitorResourceListResponse{
// Value: []*armelastic.MonitorResource{
// {
// Name: to.Ptr("myMonitor"),
// Type: to.Ptr("Microsoft.Elastic/monitors"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"),
// Location: to.Ptr("West US 2"),
// Properties: &armelastic.MonitorProperties{
// ElasticProperties: &armelastic.Properties{
// ElasticCloudDeployment: &armelastic.CloudDeployment{
// Name: to.Ptr("deploymentname"),
// AzureSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// DeploymentID: to.Ptr("deployment_id"),
// ElasticsearchRegion: to.Ptr("azure-westus2"),
// ElasticsearchServiceURL: to.Ptr("https://elasticsearchendpoint.com"),
// KibanaServiceURL: to.Ptr("https://kibanaserviceurl.com"),
// KibanaSsoURL: to.Ptr("https://kibanssourl.com"),
// },
// ElasticCloudUser: &armelastic.CloudUser{
// ElasticCloudSsoDefaultURL: to.Ptr("https://examplessourl.com"),
// EmailAddress: to.Ptr("alice@microsoft.com"),
// ID: to.Ptr("myid123"),
// },
// },
// LiftrResourceCategory: to.Ptr(armelastic.LiftrResourceCategoriesMonitorLogs),
// LiftrResourcePreference: to.Ptr[int32](0),
// MonitoringStatus: to.Ptr(armelastic.MonitoringStatusEnabled),
// ProvisioningState: to.Ptr(armelastic.ProvisioningStateSucceeded),
// },
// Tags: map[string]*string{
// "Environment": to.Ptr("Dev"),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,63 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/Monitors_Update.json
func ExampleMonitorsClient_Update() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewMonitorsClient().Update(ctx, "myResourceGroup", "myMonitor", &armelastic.MonitorsClientUpdateOptions{Body: 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.MonitorResource = armelastic.MonitorResource{
// Name: to.Ptr("myMonitor"),
// Type: to.Ptr("Microsoft.Elastic/monitors"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/monitors/myMonitor"),
// Location: to.Ptr("West US 2"),
// Properties: &armelastic.MonitorProperties{
// ElasticProperties: &armelastic.Properties{
// ElasticCloudDeployment: &armelastic.CloudDeployment{
// Name: to.Ptr("deploymentname"),
// AzureSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// DeploymentID: to.Ptr("deployment_id"),
// ElasticsearchRegion: to.Ptr("azure-westus2"),
// ElasticsearchServiceURL: to.Ptr("https://elasticsearchendpoint.com"),
// KibanaServiceURL: to.Ptr("https://kibanaserviceurl.com"),
// KibanaSsoURL: to.Ptr("https://kibanssourl.com"),
// },
// ElasticCloudUser: &armelastic.CloudUser{
// ElasticCloudSsoDefaultURL: to.Ptr("https://examplessourl.com"),
// EmailAddress: to.Ptr("alice@microsoft.com"),
// ID: to.Ptr("myid123"),
// },
// },
// LiftrResourceCategory: to.Ptr(armelastic.LiftrResourceCategoriesMonitorLogs),
// LiftrResourcePreference: to.Ptr[int32](0),
// MonitoringStatus: to.Ptr(armelastic.MonitoringStatusEnabled),
// ProvisioningState: to.Ptr(armelastic.ProvisioningStateSucceeded),
// },
// SKU: &armelastic.ResourceSKU{
// Name: to.Ptr("free_Monthly"),
// },
// Tags: map[string]*string{
// "Environment": to.Ptr("Dev"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,39 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/OpenAI_CreateOrUpdate.json
func ExampleOpenAIClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewOpenAIClient().CreateOrUpdate(ctx, "myResourceGroup", "myMonitor", "default", &armelastic.OpenAIClientCreateOrUpdateOptions{Body: 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.OpenAIIntegrationRPModel = armelastic.OpenAIIntegrationRPModel{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Elastic/monitors/openAIIntegration"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/openAIIntegration/default"),
// Properties: &armelastic.OpenAIIntegrationProperties{
// LastRefreshAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-12T09:28:50.957Z"); return t}()),
// OpenAIResourceEndpoint: to.Ptr("https://myOpenAI.openai.azure.com/"),
// OpenAIResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/myOpenAI"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,26 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/OpenAI_Delete.json
func ExampleOpenAIClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewOpenAIClient().Delete(ctx, "myResourceGroup", "myMonitor", "default", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,39 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/OpenAI_Get.json
func ExampleOpenAIClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewOpenAIClient().Get(ctx, "myResourceGroup", "myMonitor", "default", 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.OpenAIIntegrationRPModel = armelastic.OpenAIIntegrationRPModel{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Elastic/monitors/openAIIntegration"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/openAIIntegration/default"),
// Properties: &armelastic.OpenAIIntegrationProperties{
// LastRefreshAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-12T09:28:50.957Z"); return t}()),
// OpenAIResourceEndpoint: to.Ptr("https://myOpenAI.openai.azure.com/"),
// OpenAIResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/myOpenAI"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/OpenAI_GetStatus.json
func ExampleOpenAIClient_GetStatus() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewOpenAIClient().GetStatus(ctx, "myResourceGroup", "myMonitor", "default", 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.OpenAIIntegrationStatusResponse = armelastic.OpenAIIntegrationStatusResponse{
// Properties: &armelastic.OpenAIIntegrationStatusResponseProperties{
// Status: to.Ptr("Succeeded"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,47 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/OpenAI_List.json
func ExampleOpenAIClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewOpenAIClient().NewListPager("myResourceGroup", "myMonitor", 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.OpenAIIntegrationRPModelListResponse = armelastic.OpenAIIntegrationRPModelListResponse{
// Value: []*armelastic.OpenAIIntegrationRPModel{
// {
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Elastic/monitors/openAIIntegration"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/openAIIntegration/default"),
// Properties: &armelastic.OpenAIIntegrationProperties{
// LastRefreshAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-07-12T09:28:50.957Z"); return t}()),
// OpenAIResourceEndpoint: to.Ptr("https://myOpenAI.openai.azure.com/"),
// OpenAIResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.CognitiveServices/accounts/myOpenAI"),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,46 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/Operations_List.json
func ExampleOperationsClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewOperationsClient().NewListPager(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.OperationListResult = armelastic.OperationListResult{
// Value: []*armelastic.OperationResult{
// {
// Name: to.Ptr("Microsoft.Elastic/monitors/write"),
// Display: &armelastic.OperationDisplay{
// Description: to.Ptr("Write monitors resource"),
// Operation: to.Ptr("write"),
// Provider: to.Ptr("Microsoft.Elastic"),
// Resource: to.Ptr("monitors"),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/Organizations_GetApiKey.json
func ExampleOrganizationsClient_GetAPIKey() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewOrganizationsClient().GetAPIKey(ctx, &armelastic.OrganizationsClientGetAPIKeyOptions{Body: 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.UserAPIKeyResponse = armelastic.UserAPIKeyResponse{
// Properties: &armelastic.UserAPIKeyResponseProperties{
// APIKey: to.Ptr("AbCdEfGhIjKlMnOpQrStUvWxYz"),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,44 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/Organizations_GetElasticToAzureSubscriptionMapping.json
func ExampleOrganizationsClient_GetElasticToAzureSubscriptionMapping() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewOrganizationsClient().GetElasticToAzureSubscriptionMapping(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.OrganizationToAzureSubscriptionMappingResponse = armelastic.OrganizationToAzureSubscriptionMappingResponse{
// Properties: &armelastic.OrganizationToAzureSubscriptionMappingResponseProperties{
// BilledAzureSubscriptionID: to.Ptr("00000000-0000-0000-0000-000000000000"),
// ElasticOrganizationID: to.Ptr("1234567890"),
// ElasticOrganizationName: to.Ptr("elasticOrganizationName"),
// MarketplaceSaasInfo: &armelastic.MarketplaceSaaSInfo{
// MarketplaceName: to.Ptr("MP_RESOURCE"),
// MarketplaceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.SaaS/resources/AzElastic_b1190c8f"),
// MarketplaceStatus: to.Ptr("Status"),
// MarketplaceSubscription: &armelastic.MarketplaceSaaSInfoMarketplaceSubscription{
// ID: to.Ptr("12345678-1234-1234-1234-123456789012"),
// },
// },
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,34 @@
package armelastic_test
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/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/PrivateLinkTrafficFilters_Create.json
func ExampleCreateAndAssociatePLFilterClient_BeginCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewCreateAndAssociatePLFilterClient().BeginCreate(ctx, "myResourceGroup", "myMonitor", &armelastic.CreateAndAssociatePLFilterClientBeginCreateOptions{Name: nil,
PrivateEndpointGUID: to.Ptr("fdb54d3b-e85e-4d08-8958-0d2f7g523df9"),
PrivateEndpointName: to.Ptr("myPrivateEndpoint"),
})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,53 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/TagRules_CreateOrUpdate.json
func ExampleTagRulesClient_CreateOrUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewTagRulesClient().CreateOrUpdate(ctx, "myResourceGroup", "myMonitor", "default", &armelastic.TagRulesClientCreateOrUpdateOptions{Body: 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.MonitoringTagRules = armelastic.MonitoringTagRules{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Datadog/monitors/tagRules"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/tagRules/default"),
// Properties: &armelastic.MonitoringTagRulesProperties{
// LogRules: &armelastic.LogRules{
// FilteringTags: []*armelastic.FilteringTag{
// {
// Name: to.Ptr("Environment"),
// Action: to.Ptr(armelastic.TagActionInclude),
// Value: to.Ptr("Prod"),
// },
// {
// Name: to.Ptr("Environment"),
// Action: to.Ptr(armelastic.TagActionExclude),
// Value: to.Ptr("Dev"),
// }},
// SendAADLogs: to.Ptr(false),
// SendActivityLogs: to.Ptr(true),
// SendSubscriptionLogs: to.Ptr(true),
// },
// ProvisioningState: to.Ptr(armelastic.ProvisioningStateSucceeded),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,30 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/TagRules_Delete.json
func ExampleTagRulesClient_BeginDelete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewTagRulesClient().BeginDelete(ctx, "myResourceGroup", "myMonitor", "default", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,53 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/TagRules_Get.json
func ExampleTagRulesClient_Get() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewTagRulesClient().Get(ctx, "myResourceGroup", "myMonitor", "default", 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.MonitoringTagRules = armelastic.MonitoringTagRules{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Datadog/monitors/tagRules"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/tagRules/default"),
// Properties: &armelastic.MonitoringTagRulesProperties{
// LogRules: &armelastic.LogRules{
// FilteringTags: []*armelastic.FilteringTag{
// {
// Name: to.Ptr("Environment"),
// Action: to.Ptr(armelastic.TagActionInclude),
// Value: to.Ptr("Prod"),
// },
// {
// Name: to.Ptr("Environment"),
// Action: to.Ptr(armelastic.TagActionExclude),
// Value: to.Ptr("Dev"),
// }},
// SendAADLogs: to.Ptr(false),
// SendActivityLogs: to.Ptr(true),
// SendSubscriptionLogs: to.Ptr(true),
// },
// ProvisioningState: to.Ptr(armelastic.ProvisioningStateSucceeded),
// },
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,61 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/TagRules_List.json
func ExampleTagRulesClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewTagRulesClient().NewListPager("myResourceGroup", "myMonitor", 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.MonitoringTagRulesListResponse = armelastic.MonitoringTagRulesListResponse{
// Value: []*armelastic.MonitoringTagRules{
// {
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.Datadog/monitors/tagRules"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Datadog/monitors/myMonitor/tagRules/default"),
// Properties: &armelastic.MonitoringTagRulesProperties{
// LogRules: &armelastic.LogRules{
// FilteringTags: []*armelastic.FilteringTag{
// {
// Name: to.Ptr("Environment"),
// Action: to.Ptr(armelastic.TagActionInclude),
// Value: to.Ptr("Prod"),
// },
// {
// Name: to.Ptr("Environment"),
// Action: to.Ptr(armelastic.TagActionExclude),
// Value: to.Ptr("Dev"),
// }},
// SendAADLogs: to.Ptr(false),
// SendActivityLogs: to.Ptr(true),
// SendSubscriptionLogs: to.Ptr(true),
// },
// ProvisioningState: to.Ptr(armelastic.ProvisioningStateSucceeded),
// },
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,27 @@
package armelastic_test
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/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/TrafficFilters_Delete.json
func ExampleTrafficFiltersClient_Delete() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewTrafficFiltersClient().Delete(ctx, "myResourceGroup", "myMonitor", &armelastic.TrafficFiltersClientDeleteOptions{RulesetID: to.Ptr("31d91b5afb6f4c2eaaf104c97b1991dd")})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,35 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/UpgradableVersions_Details.json
func ExampleUpgradableVersionsClient_Details() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewUpgradableVersionsClient().Details(ctx, "myResourceGroup", "myMonitor", 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.UpgradableVersionsList = armelastic.UpgradableVersionsList{
// CurrentVersion: to.Ptr("7.15.0"),
// UpgradableVersions: []*string{
// to.Ptr("7.15.1"),
// to.Ptr("7.16.0")},
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,26 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/VMCollection_Update.json
func ExampleVMCollectionClient_Update() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
_, err = clientFactory.NewVMCollectionClient().Update(ctx, "myResourceGroup", "myMonitor", &armelastic.VMCollectionClientUpdateOptions{Body: nil})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,40 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/VMHost_List.json
func ExampleVMHostClient_NewListPager() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
pager := clientFactory.NewVMHostClient().NewListPager("myResourceGroup", "myMonitor", 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.VMHostListResponse = armelastic.VMHostListResponse{
// Value: []*armelastic.VMResources{
// {
// VMResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualmachines/myVM"),
// }},
// }
}
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}

Просмотреть файл

@ -0,0 +1,33 @@
package armelastic_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/elastic/armelastic"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/ad60d7f8eba124edc6999677c55aba2184e303b0/specification/elastic/resource-manager/Microsoft.Elastic/stable/2024-03-01/examples/VMIngestion_Details.json
func ExampleVMIngestionClient_Details() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armelastic.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewVMIngestionClient().Details(ctx, "myResourceGroup", "myMonitor", 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.VMIngestionDetailsResponse = armelastic.VMIngestionDetailsResponse{
// CloudID: to.Ptr("myid123"),
// IngestionKey: to.Ptr("Vmingeationkey"),
// }
}

Просмотреть файл

@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-go/blob/sdk%2Fresourcemanager%2Felastic%2Farmelastic%2Fv1.0.0/sdk/resourcemanager/elastic/armelastic/README.md"}