armhybridkubernetes

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 14 Imported by: 1

README

Azure Kubernetes Connect Service Module for Go

PkgGoDev

The armhybridkubernetes module provides operations for working with Azure Kubernetes Connect Service.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Kubernetes Connect Service module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridkubernetes/armhybridkubernetes

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Kubernetes Connect Service. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Kubernetes Connect Service module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armhybridkubernetes.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armhybridkubernetes.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewConnectedClusterClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Kubernetes Connect Service label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationMethod

type AuthenticationMethod string

AuthenticationMethod - The mode of client authentication.

const (
	AuthenticationMethodAAD   AuthenticationMethod = "AAD"
	AuthenticationMethodToken AuthenticationMethod = "Token"
)

func PossibleAuthenticationMethodValues

func PossibleAuthenticationMethodValues() []AuthenticationMethod

PossibleAuthenticationMethodValues returns the possible values for the AuthenticationMethod const type.

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) NewConnectedClusterClient added in v1.1.0

func (c *ClientFactory) NewConnectedClusterClient() *ConnectedClusterClient

NewConnectedClusterClient creates a new instance of ConnectedClusterClient.

func (*ClientFactory) NewOperationsClient added in v1.1.0

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

type ConnectedCluster

type ConnectedCluster struct {
	// REQUIRED; The identity of the connected cluster.
	Identity *ConnectedClusterIdentity

	// REQUIRED; The geo-location where the resource lives
	Location *string

	// REQUIRED; Describes the connected cluster resource properties.
	Properties *ConnectedClusterProperties

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Metadata pertaining to creation and last modification of the resource
	SystemData *SystemData

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ConnectedCluster - Represents a connected cluster.

func (ConnectedCluster) MarshalJSON

func (c ConnectedCluster) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ConnectedCluster.

func (*ConnectedCluster) UnmarshalJSON added in v1.1.0

func (c *ConnectedCluster) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedCluster.

type ConnectedClusterClient

type ConnectedClusterClient struct {
	// contains filtered or unexported fields
}

ConnectedClusterClient contains the methods for the ConnectedCluster group. Don't use this type directly, use NewConnectedClusterClient() instead.

func NewConnectedClusterClient

func NewConnectedClusterClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectedClusterClient, error)

NewConnectedClusterClient creates a new instance of ConnectedClusterClient 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 (*ConnectedClusterClient) BeginCreate

func (client *ConnectedClusterClient) BeginCreate(ctx context.Context, resourceGroupName string, clusterName string, connectedCluster ConnectedCluster, options *ConnectedClusterClientBeginCreateOptions) (*runtime.Poller[ConnectedClusterClientCreateResponse], error)

BeginCreate - API to register a new Kubernetes cluster and create a tracked resource in Azure Resource Manager (ARM). If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - The name of the Kubernetes cluster on which get is called.
  • connectedCluster - Parameters supplied to Create a Connected Cluster.
  • options - ConnectedClusterClientBeginCreateOptions contains the optional parameters for the ConnectedClusterClient.BeginCreate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/CreateClusterExample.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/hybridkubernetes/armhybridkubernetes"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhybridkubernetes.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewConnectedClusterClient().BeginCreate(ctx, "k8sc-rg", "testCluster", armhybridkubernetes.ConnectedCluster{
		Location: to.Ptr("East US"),
		Tags:     map[string]*string{},
		Identity: &armhybridkubernetes.ConnectedClusterIdentity{
			Type: to.Ptr(armhybridkubernetes.ResourceIdentityTypeSystemAssigned),
		},
		Properties: &armhybridkubernetes.ConnectedClusterProperties{
			AgentPublicKeyCertificate: to.Ptr("MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO"),
		},
	}, 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.ConnectedCluster = armhybridkubernetes.ConnectedCluster{
	// 	Name: to.Ptr("connectedCluster1"),
	// 	Type: to.Ptr("Microsoft.Kubernetes/connectedClusters"),
	// 	ID: to.Ptr("/subscriptions/1bfbb5d0-917e-4346-9026-1d3b344417f5/resourceGroups/akkeshar/providers/Microsoft.Kubernetes/connectedClusters/connectedCluster1"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Identity: &armhybridkubernetes.ConnectedClusterIdentity{
	// 		Type: to.Ptr(armhybridkubernetes.ResourceIdentityTypeSystemAssigned),
	// 	},
	// 	Properties: &armhybridkubernetes.ConnectedClusterProperties{
	// 		AgentPublicKeyCertificate: to.Ptr("MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO"),
	// 		AgentVersion: to.Ptr("0.1.0"),
	// 		KubernetesVersion: to.Ptr("1.17.0"),
	// 		ProvisioningState: to.Ptr(armhybridkubernetes.ProvisioningStateSucceeded),
	// 		TotalNodeCount: to.Ptr[int32](2),
	// 	},
	// 	SystemData: &armhybridkubernetes.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
	// 		CreatedBy: to.Ptr("sikasire@microsoft.com"),
	// 		CreatedByType: to.Ptr(armhybridkubernetes.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("sikasire@microsoft.com"),
	// 		LastModifiedByType: to.Ptr(armhybridkubernetes.LastModifiedByTypeUser),
	// 	},
	// }
}
Output:

func (*ConnectedClusterClient) BeginDelete

BeginDelete - Delete a connected cluster, removing the tracked resource in Azure Resource Manager (ARM). If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - The name of the Kubernetes cluster on which get is called.
  • options - ConnectedClusterClientBeginDeleteOptions contains the optional parameters for the ConnectedClusterClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/DeleteClusterExample.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridkubernetes/armhybridkubernetes"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhybridkubernetes.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewConnectedClusterClient().BeginDelete(ctx, "k8sc-rg", "testCluster", 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)
	}
}
Output:

func (*ConnectedClusterClient) Get

Get - Returns the properties of the specified connected cluster, including name, identity, properties, and additional cluster details. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - The name of the Kubernetes cluster on which get is called.
  • options - ConnectedClusterClientGetOptions contains the optional parameters for the ConnectedClusterClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/GetClusterExample.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridkubernetes/armhybridkubernetes"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhybridkubernetes.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConnectedClusterClient().Get(ctx, "k8sc-rg", "testCluster", 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.ConnectedCluster = armhybridkubernetes.ConnectedCluster{
	// 	Name: to.Ptr("connectedCluster1"),
	// 	Type: to.Ptr("Microsoft.Kubernetes/connectedClusters"),
	// 	ID: to.Ptr("/subscriptions/1bfbb5d0-917e-4346-9026-1d3b344417f5/resourceGroups/akkeshar/providers/Microsoft.Kubernetes/connectedClusters/connectedCluster1"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Identity: &armhybridkubernetes.ConnectedClusterIdentity{
	// 		Type: to.Ptr(armhybridkubernetes.ResourceIdentityTypeSystemAssigned),
	// 		PrincipalID: to.Ptr("d8cd1fd9-154f-4da7-b348-595f283c13a3"),
	// 		TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
	// 	},
	// 	Properties: &armhybridkubernetes.ConnectedClusterProperties{
	// 		AgentPublicKeyCertificate: to.Ptr("MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO"),
	// 		AgentVersion: to.Ptr("0.1.0"),
	// 		KubernetesVersion: to.Ptr("1.17.0"),
	// 		ProvisioningState: to.Ptr(armhybridkubernetes.ProvisioningStateSucceeded),
	// 		TotalNodeCount: to.Ptr[int32](2),
	// 	},
	// 	SystemData: &armhybridkubernetes.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
	// 		CreatedBy: to.Ptr("sikasire@microsoft.com"),
	// 		CreatedByType: to.Ptr(armhybridkubernetes.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:14:58.865Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("2d2a754c-cade-4935-83d4-ce413c5a3910"),
	// 		LastModifiedByType: to.Ptr(armhybridkubernetes.LastModifiedByTypeApplication),
	// 	},
	// }
}
Output:

func (*ConnectedClusterClient) ListClusterUserCredential

ListClusterUserCredential - Gets cluster user credentials of the connected cluster with a specified resource group and name. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - The name of the Kubernetes cluster on which get is called.
  • properties - ListClusterUserCredential properties
  • options - ConnectedClusterClientListClusterUserCredentialOptions contains the optional parameters for the ConnectedClusterClient.ListClusterUserCredential method.
Example (ListClusterUserCredentialCspExample)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultHPAAD.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/hybridkubernetes/armhybridkubernetes"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhybridkubernetes.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConnectedClusterClient().ListClusterUserCredential(ctx, "k8sc-rg", "testCluster", armhybridkubernetes.ListClusterUserCredentialProperties{
		AuthenticationMethod: to.Ptr(armhybridkubernetes.AuthenticationMethodAAD),
		ClientProxy:          to.Ptr(false),
	}, 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.CredentialResults = armhybridkubernetes.CredentialResults{
	// 	Kubeconfigs: []*armhybridkubernetes.CredentialResult{
	// 		{
	// 			Name: to.Ptr("credentialName1"),
	// 			Value: []byte("YXBpVmVyc2lvbjogdjENCmNsdXN0ZXJzOg0KLSBjbHVzdGVyOg0KICAgIGNlcnRpZmljYXRlLWF1dGhvcml0eS1kYXRhOiBMUzB0TFMxQ1JVZEpUaUJEUlZKVVNVWkpRMEZVUlMwdExTMHRDazFKU1VWNGVrTkRRWEVyWjBGM1NVSkJaMGxSVTJ0dVdsWnZaekp1VmpKVmNYZEtjblZYTTFCSGVrRk9RbWRyY1docmFVYzVkekJDUVZGelJrRkVRVTRLVFZGemQwTlJXVVJXVVZGRVJYZEthbGVsSlEwbHFRVTVDWjJ0eGFHdHBSemwzTUVKQlVVVkdRVUZQUTBGbk9FRk5TVWxEUTJkTFEwRm5SVUUwV1hCNUNsUmtUMVJSU1dNdmVsaERlR3hTZWtVMF"),
	// 	}},
	// }
}
Output:

Example (ListClusterUserCredentialExample)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultCSPAAD.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/hybridkubernetes/armhybridkubernetes"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhybridkubernetes.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConnectedClusterClient().ListClusterUserCredential(ctx, "k8sc-rg", "testCluster", armhybridkubernetes.ListClusterUserCredentialProperties{
		AuthenticationMethod: to.Ptr(armhybridkubernetes.AuthenticationMethodAAD),
		ClientProxy:          to.Ptr(true),
	}, 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.CredentialResults = armhybridkubernetes.CredentialResults{
	// 	HybridConnectionConfig: &armhybridkubernetes.HybridConnectionConfig{
	// 		ExpirationTime: to.Ptr[int64](1631196183),
	// 		HybridConnectionName: to.Ptr("microsoft.kubernetes/connectedclusters/229dc73f7b07196c79a93d4362d9c7fc4ed34df3e95290d27c56cec2dbb82865/1631185383340987904"),
	// 		Relay: to.Ptr("azgnrelay-ph0-l1"),
	// 		Token: to.Ptr("SharedAccessSignature 123456789034675890pbduwegiavifkuw647o02423bbhfouseb"),
	// 	},
	// 	Kubeconfigs: []*armhybridkubernetes.CredentialResult{
	// 		{
	// 			Name: to.Ptr("credentialName1"),
	// 			Value: []byte("YXBpVmVyc2lvbjogdjENCmNsdXN0ZXJzOg0KLSBjbHVzdGVyOg0KICAgIGNlcnRpZmljYXRlLWF1dGhvcml0eS1kYXRhOiBMUzB0TFMxQ1JVZEpUaUJEUlZKVVNVWkpRMEZVUlMwdExTMHRDazFKU1VWNGVrTkRRWEVyWjBGM1NVSkJaMGxSVTJ0dVdsWnZaekp1VmpKVmNYZEtjblZYTTFCSGVrRk9RbWRyY1docmFVYzVkekJDUVZGelJrRkVRVTRLVFZGemQwTlJXVVJXVVZGRVJYZEthbGVsSlEwbHFRVTVDWjJ0eGFHdHBSemwzTUVKQlVVVkdRVUZQUTBGbk9FRk5TVWxEUTJkTFEwRm5SVUUwV1hCNUNsUmtUMVJSU1dNdmVsaERlR3hTZWtVMF"),
	// 	}},
	// }
}
Output:

Example (ListClusterUserCredentialNonAadCspExample)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultHPToken.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/hybridkubernetes/armhybridkubernetes"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhybridkubernetes.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConnectedClusterClient().ListClusterUserCredential(ctx, "k8sc-rg", "testCluster", armhybridkubernetes.ListClusterUserCredentialProperties{
		AuthenticationMethod: to.Ptr(armhybridkubernetes.AuthenticationMethodToken),
		ClientProxy:          to.Ptr(false),
	}, 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.CredentialResults = armhybridkubernetes.CredentialResults{
	// 	Kubeconfigs: []*armhybridkubernetes.CredentialResult{
	// 		{
	// 			Name: to.Ptr("credentialName1"),
	//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2x1c3RlclVzZXJfdGVzdF9jbHVzdGVyCiAgICB1c2VyOgogICAgICB0b2tlbjogMmM2NGZyMmQ2MWRhZmZkODY4NGJkYTc3M2Y2YTQ3OGUxZTU4NzlhZTE1ZmRkM2Q1NDU4NGNkNTM1MGM2YWUxMzlhMGI3OTk4YTc2ZjFhOTdlOGI3Y2EwNTJiYjIwZWY0ZjljZTAzN2Q5YTMyM2ZjMTYxZmI0MGI4OTVlOWIwZjM="),
	// 	}},
	// }
}
Output:

Example (ListClusterUserCredentialNonAadExample)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ConnectedClustersListClusterCredentialResultCSPToken.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/hybridkubernetes/armhybridkubernetes"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhybridkubernetes.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConnectedClusterClient().ListClusterUserCredential(ctx, "k8sc-rg", "testCluster", armhybridkubernetes.ListClusterUserCredentialProperties{
		AuthenticationMethod: to.Ptr(armhybridkubernetes.AuthenticationMethodToken),
		ClientProxy:          to.Ptr(true),
	}, 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.CredentialResults = armhybridkubernetes.CredentialResults{
	// 	HybridConnectionConfig: &armhybridkubernetes.HybridConnectionConfig{
	// 		ExpirationTime: to.Ptr[int64](1631196183),
	// 		HybridConnectionName: to.Ptr("microsoft.kubernetes/connectedclusters/229dc73f7b07196c79a93d4362d9c7fc4ed34df3e95290d27c56cec2dbb82865/1631185383340987904"),
	// 		Relay: to.Ptr("azgnrelay-ph0-l1"),
	// 		Token: to.Ptr("SharedAccessSignature 123456789034675890pbduwegiavifkuw647o02423bbhfouseb"),
	// 	},
	// 	Kubeconfigs: []*armhybridkubernetes.CredentialResult{
	// 		{
	// 			Name: to.Ptr("credentialName1"),
	// 			Value: []byte("YXBpVmVyc2lvbjogdjEKY2x1c3RlcnM6CiAgLSBjbHVzdGVyOgogICAgICBjZXJ0aWZpY2F0ZS1hdXRob3JpdHktZGF0YTogTFMwdExTMUNSVWRKVGlCRFJWSlVTVVpKUTBGVVJTMHRMUzB0Q2sxSlNVaDJWRU5EUW1GWFowRjNTVUpCWjBsVVlYZEJRVUV5VkhWQlRYaEJhVWx5UldsQlFVRkJRVUZFV2tSQlRrSm5hM0ZvYTJsSE9YY3dRa0ZSYzBaQlJFSlFUVkZ6ZDBOUldVUldVVkZIUlhkS1ZsVjZSV1ZOUW5kSFFURlZSVU5vVFZaVVYyeHFZMjA1ZW1JeVdqQkpSVTUyWTI1Q2RtTnRSakJoVnpsMVRWTkJkMGhuV1VSV1VWRkVSWGhrVG1GWFRubGlNMDUyV201UloxVnNUa0pKUmxKTlZYbENSRkZUUVhkTlZFRmxSbmN3ZVUxRVFUUk5hbU40VFdwTmVFNVVXbUZHZHpCNVRWUkJORTFxWTNoTmFrMTRUbFJhWVUxRFdYaEtSRUZwUW1kT1ZrSkJUVTFIZVc5MVlYcG9lbGt5T1hWaWJWWnFaRU0xTUZwWVRqQk1iVVkyWkZoS2JFeHRUblppVkVORFFWTkpkMFJSV1VwTGIxcEphSFpqVGtGUlJVSkNVVUZFWjJkRlVFRkVRME5CVVc5RFoyZEZRa0ZOU0VwVU0wZEtXbWhMTm5KaVVHSm9XRWN6V21SU05HVlhNS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zNjIwLms4c2Nvbm5lY3QudGVzdC5henVyZS5jb20KICAgIG5hbWU6IGNsdXN0ZXIKY29udGV4dHM6CiAgLSBjb250ZXh0OgogICAgICBjbHVzdGVyOiBjbHVzdGVyCiAgICAgIHVzZXI6IGNsdXN0ZXJVc2VyX3Rlc3RfY2x1c3RlcgogICAgbmFtZTogY2x1c3RlcgpjdXJyZW50LWNvbnRleHQ6IGNsdXN0ZXIKa2luZDogQ29uZmlnCnByZWZlcmVuY2VzOiBudWxsCnVzZXJzOgogIC0gbmFtZTogY2x1c3RlclVzZXJfdGVzdF9jbHVzdGVyCiAgICB1c2VyOgogICAgICB0b2tlbjogMmM2NGZyMmQ2MWRhZmZkODY4NGJkYTc3M2Y2YTQ3OGUxZTU4NzlhZTE1ZmRkM2Q1NDU4NGNkNTM1MGM2YWUxMzlhMGI3OTk4YTc2ZjFhOTdlOGI3Y2EwNTJiYjIwZWY0ZjljZTAzN2Q5YTMyM2ZjMTYxZmI0MGI4OTVlOWIwZjM="),
	// 	}},
	// }
}
Output:

func (*ConnectedClusterClient) NewListByResourceGroupPager added in v0.4.0

NewListByResourceGroupPager - API to enumerate registered connected K8s clusters under a Resource Group

Generated from API version 2021-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • options - ConnectedClusterClientListByResourceGroupOptions contains the optional parameters for the ConnectedClusterClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/GetClustersByResourceGroupExample.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridkubernetes/armhybridkubernetes"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhybridkubernetes.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConnectedClusterClient().NewListByResourceGroupPager("k8sc-rg", 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.ConnectedClusterList = armhybridkubernetes.ConnectedClusterList{
		// 	Value: []*armhybridkubernetes.ConnectedCluster{
		// 		{
		// 			Name: to.Ptr("connectedCluster1"),
		// 			Type: to.Ptr("Microsoft.Kubernetes/connectedClusters"),
		// 			ID: to.Ptr("/subscriptions/1bfbb5d0-917e-4346-9026-1d3b344417f5/resourceGroups/akkeshar/providers/Microsoft.Kubernetes/connectedClusters/connectedCluster1"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Identity: &armhybridkubernetes.ConnectedClusterIdentity{
		// 				Type: to.Ptr(armhybridkubernetes.ResourceIdentityTypeSystemAssigned),
		// 				PrincipalID: to.Ptr("d8cd1fd9-154f-4da7-b348-595f283c13a3"),
		// 				TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
		// 			},
		// 			Properties: &armhybridkubernetes.ConnectedClusterProperties{
		// 				AgentPublicKeyCertificate: to.Ptr("MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO"),
		// 				AgentVersion: to.Ptr("0.1.0"),
		// 				KubernetesVersion: to.Ptr("1.17.0"),
		// 				ProvisioningState: to.Ptr(armhybridkubernetes.ProvisioningStateSucceeded),
		// 				TotalNodeCount: to.Ptr[int32](2),
		// 			},
		// 			SystemData: &armhybridkubernetes.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
		// 				CreatedBy: to.Ptr("sikasire@microsoft.com"),
		// 				CreatedByType: to.Ptr(armhybridkubernetes.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("sikasire@microsoft.com"),
		// 				LastModifiedByType: to.Ptr(armhybridkubernetes.LastModifiedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("connectedCluster1"),
		// 			Type: to.Ptr("Microsoft.Kubernetes/connectedClusters"),
		// 			ID: to.Ptr("/subscriptions/1bfbb5d0-917e-4346-9026-1d3b344417f5/resourceGroups/akkeshar/providers/Microsoft.Kubernetes/connectedClusters/connectedCluster1"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Identity: &armhybridkubernetes.ConnectedClusterIdentity{
		// 				Type: to.Ptr(armhybridkubernetes.ResourceIdentityTypeSystemAssigned),
		// 				PrincipalID: to.Ptr("d8cd1fd9-154f-4da7-b348-595f283c13a3"),
		// 				TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
		// 			},
		// 			Properties: &armhybridkubernetes.ConnectedClusterProperties{
		// 				AgentPublicKeyCertificate: to.Ptr("XIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO"),
		// 				AgentVersion: to.Ptr("0.1.0"),
		// 				KubernetesVersion: to.Ptr("1.1"),
		// 				ProvisioningState: to.Ptr(armhybridkubernetes.ProvisioningStateSucceeded),
		// 				TotalNodeCount: to.Ptr[int32](2),
		// 			},
		// 			SystemData: &armhybridkubernetes.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
		// 				CreatedBy: to.Ptr("sikasire@microsoft.com"),
		// 				CreatedByType: to.Ptr(armhybridkubernetes.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("sikasire@microsoft.com"),
		// 				LastModifiedByType: to.Ptr(armhybridkubernetes.LastModifiedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ConnectedClusterClient) NewListBySubscriptionPager added in v0.4.0

NewListBySubscriptionPager - API to enumerate registered connected K8s clusters under a Subscription

Generated from API version 2021-10-01

  • options - ConnectedClusterClientListBySubscriptionOptions contains the optional parameters for the ConnectedClusterClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/GetClustersBySubscriptionExample.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridkubernetes/armhybridkubernetes"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhybridkubernetes.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewConnectedClusterClient().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.ConnectedClusterList = armhybridkubernetes.ConnectedClusterList{
		// 	Value: []*armhybridkubernetes.ConnectedCluster{
		// 		{
		// 			Name: to.Ptr("connectedCluster1"),
		// 			Type: to.Ptr("Microsoft.Kubernetes/connectedClusters"),
		// 			ID: to.Ptr("/subscriptions/1bfbb5d0-917e-4346-9026-1d3b344417f5/resourceGroups/akkeshar/providers/Microsoft.Kubernetes/connectedClusters/connectedCluster1"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Identity: &armhybridkubernetes.ConnectedClusterIdentity{
		// 				Type: to.Ptr(armhybridkubernetes.ResourceIdentityTypeSystemAssigned),
		// 				PrincipalID: to.Ptr("d8cd1fd9-154f-4da7-b348-595f283c13a3"),
		// 				TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
		// 			},
		// 			Properties: &armhybridkubernetes.ConnectedClusterProperties{
		// 				AgentPublicKeyCertificate: to.Ptr("MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO"),
		// 				AgentVersion: to.Ptr("0.1.0"),
		// 				KubernetesVersion: to.Ptr("1.17.0"),
		// 				ProvisioningState: to.Ptr(armhybridkubernetes.ProvisioningStateSucceeded),
		// 				TotalNodeCount: to.Ptr[int32](2),
		// 			},
		// 			SystemData: &armhybridkubernetes.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
		// 				CreatedBy: to.Ptr("sikasire@microsoft.com"),
		// 				CreatedByType: to.Ptr(armhybridkubernetes.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("sikasire@microsoft.com"),
		// 				LastModifiedByType: to.Ptr(armhybridkubernetes.LastModifiedByTypeUser),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("connectedCluster2"),
		// 			Type: to.Ptr("Microsoft.Kubernetes/connectedClusters"),
		// 			ID: to.Ptr("/subscriptions/1bfbb5d0-917e-4346-9026-1d3b344417f5/resourceGroups/akkeshar/providers/Microsoft.Kubernetes/connectedClusters/connectedCluster1"),
		// 			Location: to.Ptr("East US"),
		// 			Tags: map[string]*string{
		// 			},
		// 			Identity: &armhybridkubernetes.ConnectedClusterIdentity{
		// 				Type: to.Ptr(armhybridkubernetes.ResourceIdentityTypeSystemAssigned),
		// 				PrincipalID: to.Ptr("d8cd1fd9-154f-4da7-b348-595f283c13a3"),
		// 				TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"),
		// 			},
		// 			Properties: &armhybridkubernetes.ConnectedClusterProperties{
		// 				AgentPublicKeyCertificate: to.Ptr("XIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO"),
		// 				AgentVersion: to.Ptr("0.1.0"),
		// 				KubernetesVersion: to.Ptr("1.16.3"),
		// 				ProvisioningState: to.Ptr(armhybridkubernetes.ProvisioningStateSucceeded),
		// 				TotalNodeCount: to.Ptr[int32](4),
		// 			},
		// 			SystemData: &armhybridkubernetes.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
		// 				CreatedBy: to.Ptr("sikasire@microsoft.com"),
		// 				CreatedByType: to.Ptr(armhybridkubernetes.CreatedByTypeUser),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("sikasire@microsoft.com"),
		// 				LastModifiedByType: to.Ptr(armhybridkubernetes.LastModifiedByTypeUser),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ConnectedClusterClient) Update

func (client *ConnectedClusterClient) Update(ctx context.Context, resourceGroupName string, clusterName string, connectedClusterPatch ConnectedClusterPatch, options *ConnectedClusterClientUpdateOptions) (ConnectedClusterClientUpdateResponse, error)

Update - API to update certain properties of the connected cluster resource If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2021-10-01

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • clusterName - The name of the Kubernetes cluster on which get is called.
  • connectedClusterPatch - Parameters supplied to update Connected Cluster.
  • options - ConnectedClusterClientUpdateOptions contains the optional parameters for the ConnectedClusterClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/UpdateClusterExample.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/hybridkubernetes/armhybridkubernetes"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhybridkubernetes.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewConnectedClusterClient().Update(ctx, "k8sc-rg", "testCluster", armhybridkubernetes.ConnectedClusterPatch{
		Tags: map[string]*string{
			"tag1": to.Ptr("value1"),
			"tag2": to.Ptr("value2"),
		},
	}, 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.ConnectedCluster = armhybridkubernetes.ConnectedCluster{
	// 	Name: to.Ptr("connectedCluster1"),
	// 	Type: to.Ptr("Microsoft.Kubernetes/connectedClusters"),
	// 	ID: to.Ptr("/subscriptions/1bfbb5d0-917e-4346-9026-1d3b344417f5/resourceGroups/akkeshar/providers/Microsoft.Kubernetes/connectedClusters/connectedCluster1"),
	// 	Location: to.Ptr("East US"),
	// 	Tags: map[string]*string{
	// 	},
	// 	Identity: &armhybridkubernetes.ConnectedClusterIdentity{
	// 		Type: to.Ptr(armhybridkubernetes.ResourceIdentityTypeSystemAssigned),
	// 	},
	// 	Properties: &armhybridkubernetes.ConnectedClusterProperties{
	// 		AgentPublicKeyCertificate: to.Ptr("MIICYzCCAcygAwIBAgIBADANBgkqhkiG9w0BAQUFADAuMQswCQYDVQQGEwJVUzEMMAoGA1UEChMDSUJNMREwDwYDVQQLEwhMb2NhbCBDQTAeFw05OTEyMjIwNTAwMDBaFw0wMDEyMjMwNDU5NTlaMC4xCzAJBgNVBAYTAlVTMQwwCgYDVQQKEwNJQk0xETAPBgNVBAsTCExvY2FsIENBMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD2bZEo7xGaX2/0GHkrNFZvlxBou9v1Jmt/PDiTMPve8r9FeJAQ0QdvFST/0JPQYD20rH0bimdDLgNdNynmyRoS2S/IInfpmf69iyc2G0TPyRvmHIiOZbdCd+YBHQi1adkj17NDcWj6S14tVurFX73zx0sNoMS79q3tuXKrDsxeuwIDAQABo4GQMIGNMEsGCVUdDwGG+EIBDQQ+EzxHZW5lcmF0ZWQgYnkgdGhlIFNlY3VyZVdheSBTZWN1cml0eSBTZXJ2ZXIgZm9yIE9TLzM5MCAoUkFDRikwDgYDVR0PAQH/BAQDAgAGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ3+ocRyCTJw067dLSwr/nalx6YMMA0GCSqGSIb3DQEBBQUAA4GBAMaQzt+zaj1GU77yzlr8iiMBXgdQrwsZZWJo5exnAucJAEYQZmOfyLiM D6oYq+ZnfvM0n8G/Y79q8nhwvuxpYOnRSAXFp6xSkrIOeZtJMY1h00LKp/JX3Ng1svZ2agE126JHsQ0bhzN5TKsYfbwfTwfjdWAGy6Vf1nYi/rO+ryMO"),
	// 		AgentVersion: to.Ptr("0.1.0"),
	// 		KubernetesVersion: to.Ptr("1.17.0"),
	// 		ProvisioningState: to.Ptr(armhybridkubernetes.ProvisioningStateSucceeded),
	// 		TotalNodeCount: to.Ptr[int32](2),
	// 	},
	// 	SystemData: &armhybridkubernetes.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:06:33.917Z"); return t}()),
	// 		CreatedBy: to.Ptr("sikasire@microsoft.com"),
	// 		CreatedByType: to.Ptr(armhybridkubernetes.CreatedByTypeUser),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-17T07:14:58.865Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("2d2a754c-cade-4935-83d4-ce413c5a3910"),
	// 		LastModifiedByType: to.Ptr(armhybridkubernetes.LastModifiedByTypeApplication),
	// 	},
	// }
}
Output:

type ConnectedClusterClientBeginCreateOptions added in v0.2.0

type ConnectedClusterClientBeginCreateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ConnectedClusterClientBeginCreateOptions contains the optional parameters for the ConnectedClusterClient.BeginCreate method.

type ConnectedClusterClientBeginDeleteOptions added in v0.2.0

type ConnectedClusterClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ConnectedClusterClientBeginDeleteOptions contains the optional parameters for the ConnectedClusterClient.BeginDelete method.

type ConnectedClusterClientCreateResponse added in v0.2.0

type ConnectedClusterClientCreateResponse struct {
	// Represents a connected cluster.
	ConnectedCluster
}

ConnectedClusterClientCreateResponse contains the response from method ConnectedClusterClient.BeginCreate.

type ConnectedClusterClientDeleteResponse added in v0.2.0

type ConnectedClusterClientDeleteResponse struct {
}

ConnectedClusterClientDeleteResponse contains the response from method ConnectedClusterClient.BeginDelete.

type ConnectedClusterClientGetOptions added in v0.2.0

type ConnectedClusterClientGetOptions struct {
}

ConnectedClusterClientGetOptions contains the optional parameters for the ConnectedClusterClient.Get method.

type ConnectedClusterClientGetResponse added in v0.2.0

type ConnectedClusterClientGetResponse struct {
	// Represents a connected cluster.
	ConnectedCluster
}

ConnectedClusterClientGetResponse contains the response from method ConnectedClusterClient.Get.

type ConnectedClusterClientListByResourceGroupOptions added in v0.2.0

type ConnectedClusterClientListByResourceGroupOptions struct {
}

ConnectedClusterClientListByResourceGroupOptions contains the optional parameters for the ConnectedClusterClient.NewListByResourceGroupPager method.

type ConnectedClusterClientListByResourceGroupResponse added in v0.2.0

type ConnectedClusterClientListByResourceGroupResponse struct {
	// The paginated list of connected Clusters
	ConnectedClusterList
}

ConnectedClusterClientListByResourceGroupResponse contains the response from method ConnectedClusterClient.NewListByResourceGroupPager.

type ConnectedClusterClientListBySubscriptionOptions added in v0.2.0

type ConnectedClusterClientListBySubscriptionOptions struct {
}

ConnectedClusterClientListBySubscriptionOptions contains the optional parameters for the ConnectedClusterClient.NewListBySubscriptionPager method.

type ConnectedClusterClientListBySubscriptionResponse added in v0.2.0

type ConnectedClusterClientListBySubscriptionResponse struct {
	// The paginated list of connected Clusters
	ConnectedClusterList
}

ConnectedClusterClientListBySubscriptionResponse contains the response from method ConnectedClusterClient.NewListBySubscriptionPager.

type ConnectedClusterClientListClusterUserCredentialOptions added in v0.2.0

type ConnectedClusterClientListClusterUserCredentialOptions struct {
}

ConnectedClusterClientListClusterUserCredentialOptions contains the optional parameters for the ConnectedClusterClient.ListClusterUserCredential method.

type ConnectedClusterClientListClusterUserCredentialResponse added in v0.2.0

type ConnectedClusterClientListClusterUserCredentialResponse struct {
	// The list of credential result response.
	CredentialResults
}

ConnectedClusterClientListClusterUserCredentialResponse contains the response from method ConnectedClusterClient.ListClusterUserCredential.

type ConnectedClusterClientUpdateOptions added in v0.2.0

type ConnectedClusterClientUpdateOptions struct {
}

ConnectedClusterClientUpdateOptions contains the optional parameters for the ConnectedClusterClient.Update method.

type ConnectedClusterClientUpdateResponse added in v0.2.0

type ConnectedClusterClientUpdateResponse struct {
	// Represents a connected cluster.
	ConnectedCluster
}

ConnectedClusterClientUpdateResponse contains the response from method ConnectedClusterClient.Update.

type ConnectedClusterIdentity

type ConnectedClusterIdentity struct {
	// REQUIRED; The type of identity used for the connected cluster. The type 'SystemAssigned, includes a system created identity.
	// The type 'None' means no identity is assigned to the connected cluster.
	Type *ResourceIdentityType

	// READ-ONLY; The principal id of connected cluster identity. This property will only be provided for a system assigned identity.
	PrincipalID *string

	// READ-ONLY; The tenant id associated with the connected cluster. This property will only be provided for a system assigned
	// identity.
	TenantID *string
}

ConnectedClusterIdentity - Identity for the connected cluster.

func (ConnectedClusterIdentity) MarshalJSON added in v1.1.0

func (c ConnectedClusterIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ConnectedClusterIdentity.

func (*ConnectedClusterIdentity) UnmarshalJSON added in v1.1.0

func (c *ConnectedClusterIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedClusterIdentity.

type ConnectedClusterList

type ConnectedClusterList struct {
	// The link to fetch the next page of connected cluster
	NextLink *string

	// The list of connected clusters
	Value []*ConnectedCluster
}

ConnectedClusterList - The paginated list of connected Clusters

func (ConnectedClusterList) MarshalJSON

func (c ConnectedClusterList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ConnectedClusterList.

func (*ConnectedClusterList) UnmarshalJSON added in v1.1.0

func (c *ConnectedClusterList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedClusterList.

type ConnectedClusterPatch

type ConnectedClusterPatch struct {
	// Describes the connected cluster resource properties that can be updated during PATCH operation.
	Properties any

	// Resource tags.
	Tags map[string]*string
}

ConnectedClusterPatch - Object containing updates for patch operations.

func (ConnectedClusterPatch) MarshalJSON

func (c ConnectedClusterPatch) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ConnectedClusterPatch.

func (*ConnectedClusterPatch) UnmarshalJSON added in v1.1.0

func (c *ConnectedClusterPatch) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedClusterPatch.

type ConnectedClusterProperties

type ConnectedClusterProperties struct {
	// REQUIRED; Base64 encoded public certificate used by the agent to do the initial handshake to the backend services in Azure.
	AgentPublicKeyCertificate *string

	// The Kubernetes distribution running on this connected cluster.
	Distribution *string

	// The infrastructure on which the Kubernetes cluster represented by this connected cluster is running on.
	Infrastructure *string

	// Provisioning state of the connected cluster resource.
	ProvisioningState *ProvisioningState

	// READ-ONLY; Version of the agent running on the connected cluster resource
	AgentVersion *string

	// READ-ONLY; Represents the connectivity status of the connected cluster.
	ConnectivityStatus *ConnectivityStatus

	// READ-ONLY; The Kubernetes version of the connected cluster resource
	KubernetesVersion *string

	// READ-ONLY; Time representing the last instance when heart beat was received from the cluster
	LastConnectivityTime *time.Time

	// READ-ONLY; Expiration time of the managed identity certificate
	ManagedIdentityCertificateExpirationTime *time.Time

	// READ-ONLY; Connected cluster offering
	Offering *string

	// READ-ONLY; Number of CPU cores present in the connected cluster resource
	TotalCoreCount *int32

	// READ-ONLY; Number of nodes present in the connected cluster resource
	TotalNodeCount *int32
}

ConnectedClusterProperties - Properties of the connected cluster.

func (ConnectedClusterProperties) MarshalJSON

func (c ConnectedClusterProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ConnectedClusterProperties.

func (*ConnectedClusterProperties) UnmarshalJSON

func (c *ConnectedClusterProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedClusterProperties.

type ConnectivityStatus

type ConnectivityStatus string

ConnectivityStatus - Represents the connectivity status of the connected cluster.

const (
	ConnectivityStatusConnected  ConnectivityStatus = "Connected"
	ConnectivityStatusConnecting ConnectivityStatus = "Connecting"
	ConnectivityStatusExpired    ConnectivityStatus = "Expired"
	ConnectivityStatusOffline    ConnectivityStatus = "Offline"
)

func PossibleConnectivityStatusValues

func PossibleConnectivityStatusValues() []ConnectivityStatus

PossibleConnectivityStatusValues returns the possible values for the ConnectivityStatus const type.

type CreatedByType

type CreatedByType string

CreatedByType - The type of identity that created the resource.

const (
	CreatedByTypeApplication     CreatedByType = "Application"
	CreatedByTypeKey             CreatedByType = "Key"
	CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity"
	CreatedByTypeUser            CreatedByType = "User"
)

func PossibleCreatedByTypeValues

func PossibleCreatedByTypeValues() []CreatedByType

PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type.

type CredentialResult

type CredentialResult struct {
	// READ-ONLY; The name of the credential.
	Name *string

	// READ-ONLY; Base64-encoded Kubernetes configuration file.
	Value []byte
}

CredentialResult - The credential result response.

func (CredentialResult) MarshalJSON

func (c CredentialResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CredentialResult.

func (*CredentialResult) UnmarshalJSON

func (c *CredentialResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CredentialResult.

type CredentialResults

type CredentialResults struct {
	// READ-ONLY; Contains the REP (rendezvous endpoint) and “Sender” access token.
	HybridConnectionConfig *HybridConnectionConfig

	// READ-ONLY; Base64-encoded Kubernetes configuration file.
	Kubeconfigs []*CredentialResult
}

CredentialResults - The list of credential result response.

func (CredentialResults) MarshalJSON

func (c CredentialResults) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CredentialResults.

func (*CredentialResults) UnmarshalJSON added in v1.1.0

func (c *CredentialResults) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CredentialResults.

type ErrorAdditionalInfo

type ErrorAdditionalInfo struct {
	// READ-ONLY; The additional info.
	Info any

	// READ-ONLY; The additional info type.
	Type *string
}

ErrorAdditionalInfo - The resource management error additional info.

func (ErrorAdditionalInfo) MarshalJSON added in v1.1.0

func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.

func (*ErrorAdditionalInfo) UnmarshalJSON added in v1.1.0

func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.

type ErrorDetail

type ErrorDetail struct {
	// READ-ONLY; The error additional info.
	AdditionalInfo []*ErrorAdditionalInfo

	// READ-ONLY; The error code.
	Code *string

	// READ-ONLY; The error details.
	Details []*ErrorDetail

	// READ-ONLY; The error message.
	Message *string

	// READ-ONLY; The error target.
	Target *string
}

ErrorDetail - The error detail.

func (ErrorDetail) MarshalJSON

func (e ErrorDetail) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorDetail.

func (*ErrorDetail) UnmarshalJSON added in v1.1.0

func (e *ErrorDetail) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.

type ErrorResponse

type ErrorResponse struct {
	// The error object.
	Error *ErrorDetail
}

ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

func (ErrorResponse) MarshalJSON added in v1.1.0

func (e ErrorResponse) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ErrorResponse.

func (*ErrorResponse) UnmarshalJSON added in v1.1.0

func (e *ErrorResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.

type HybridConnectionConfig

type HybridConnectionConfig struct {
	// READ-ONLY; Timestamp when this token will be expired.
	ExpirationTime *int64

	// READ-ONLY; Name of the connection
	HybridConnectionName *string

	// READ-ONLY; Name of the relay.
	Relay *string

	// READ-ONLY; Sender access token
	Token *string
}

HybridConnectionConfig - Contains the REP (rendezvous endpoint) and “Sender” access token.

func (HybridConnectionConfig) MarshalJSON added in v1.1.0

func (h HybridConnectionConfig) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type HybridConnectionConfig.

func (*HybridConnectionConfig) UnmarshalJSON added in v1.1.0

func (h *HybridConnectionConfig) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type HybridConnectionConfig.

type LastModifiedByType

type LastModifiedByType string

LastModifiedByType - The type of identity that last modified the resource.

const (
	LastModifiedByTypeApplication     LastModifiedByType = "Application"
	LastModifiedByTypeKey             LastModifiedByType = "Key"
	LastModifiedByTypeManagedIdentity LastModifiedByType = "ManagedIdentity"
	LastModifiedByTypeUser            LastModifiedByType = "User"
)

func PossibleLastModifiedByTypeValues

func PossibleLastModifiedByTypeValues() []LastModifiedByType

PossibleLastModifiedByTypeValues returns the possible values for the LastModifiedByType const type.

type ListClusterUserCredentialProperties

type ListClusterUserCredentialProperties struct {
	// REQUIRED; The mode of client authentication.
	AuthenticationMethod *AuthenticationMethod

	// REQUIRED; Boolean value to indicate whether the request is for client side proxy or not
	ClientProxy *bool
}

func (ListClusterUserCredentialProperties) MarshalJSON added in v1.1.0

func (l ListClusterUserCredentialProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListClusterUserCredentialProperties.

func (*ListClusterUserCredentialProperties) UnmarshalJSON added in v1.1.0

func (l *ListClusterUserCredentialProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListClusterUserCredentialProperties.

type Operation

type Operation struct {
	// READ-ONLY; The object that represents the operation.
	Display *OperationDisplay

	// READ-ONLY; Operation name: {Microsoft.Kubernetes}/{resource}/{operation}
	Name *string
}

Operation - The Connected cluster API operation

func (Operation) MarshalJSON added in v1.1.0

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON added in v1.1.0

func (o *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// Description of the operation.
	Description *string

	// Operation type: Read, write, delete, etc.
	Operation *string

	// Service provider: Microsoft.connectedClusters
	Provider *string

	// Connected Cluster Resource on which the operation is performed
	Resource *string
}

OperationDisplay - The object that represents the operation.

func (OperationDisplay) MarshalJSON added in v1.1.0

func (o OperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON added in v1.1.0

func (o *OperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationList

type OperationList struct {
	// The link to fetch the next page of connected cluster API operations.
	NextLink *string

	// READ-ONLY; The list of connected cluster API operations.
	Value []*Operation
}

OperationList - The paginated list of connected cluster API operations.

func (OperationList) MarshalJSON

func (o OperationList) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationList.

func (*OperationList) UnmarshalJSON added in v1.1.0

func (o *OperationList) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationList.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewGetPager added in v0.4.0

NewGetPager - Lists all of the available API operations for Connected Cluster resource.

Generated from API version 2021-10-01

  • options - OperationsClientGetOptions contains the optional parameters for the OperationsClient.NewGetPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/stable/2021-10-01/examples/ListConnectedClusterOperationsExample.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridkubernetes/armhybridkubernetes"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armhybridkubernetes.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewOperationsClient().NewGetPager(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.OperationList = armhybridkubernetes.OperationList{
		// 	Value: []*armhybridkubernetes.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.Kubernetes/connectedClusters/write"),
		// 			Display: &armhybridkubernetes.OperationDisplay{
		// 				Description: to.Ptr("Create any ConnectedCluster"),
		// 				Operation: to.Ptr("Create ConnectedCluster"),
		// 				Provider: to.Ptr("Microsoft.connectedClusters"),
		// 				Resource: to.Ptr("connectedClusters"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Kubernetes/connectedClusters/read"),
		// 			Display: &armhybridkubernetes.OperationDisplay{
		// 				Description: to.Ptr("Get any ConnectedCluster"),
		// 				Operation: to.Ptr("Get ConnectedCluster"),
		// 				Provider: to.Ptr("Microsoft.Kubernetes"),
		// 				Resource: to.Ptr("connectedClusters"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("Microsoft.Kubernetes/connectedClusters/delete"),
		// 			Display: &armhybridkubernetes.OperationDisplay{
		// 				Description: to.Ptr("Delete any ConnectedCluster"),
		// 				Operation: to.Ptr("Delete ConnectedCluster"),
		// 				Provider: to.Ptr("Microsoft.Kubernetes"),
		// 				Resource: to.Ptr("connectedClusters"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OperationsClientGetOptions added in v0.2.0

type OperationsClientGetOptions struct {
}

OperationsClientGetOptions contains the optional parameters for the OperationsClient.NewGetPager method.

type OperationsClientGetResponse added in v0.2.0

type OperationsClientGetResponse struct {
	// The paginated list of connected cluster API operations.
	OperationList
}

OperationsClientGetResponse contains the response from method OperationsClient.NewGetPager.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The current deployment state of connectedClusters.

const (
	ProvisioningStateAccepted     ProvisioningState = "Accepted"
	ProvisioningStateCanceled     ProvisioningState = "Canceled"
	ProvisioningStateDeleting     ProvisioningState = "Deleting"
	ProvisioningStateFailed       ProvisioningState = "Failed"
	ProvisioningStateProvisioning ProvisioningState = "Provisioning"
	ProvisioningStateSucceeded    ProvisioningState = "Succeeded"
	ProvisioningStateUpdating     ProvisioningState = "Updating"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type Resource

type Resource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Resource - Common fields that are returned in the response for all Azure Resource Manager resources

func (Resource) MarshalJSON

func (r Resource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Resource.

func (*Resource) UnmarshalJSON added in v1.1.0

func (r *Resource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Resource.

type ResourceIdentityType

type ResourceIdentityType string

ResourceIdentityType - The type of identity used for the connected cluster. The type 'SystemAssigned, includes a system created identity. The type 'None' means no identity is assigned to the connected cluster.

const (
	ResourceIdentityTypeNone           ResourceIdentityType = "None"
	ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned"
)

func PossibleResourceIdentityTypeValues

func PossibleResourceIdentityTypeValues() []ResourceIdentityType

PossibleResourceIdentityTypeValues returns the possible values for the ResourceIdentityType const type.

type SystemData

type SystemData struct {
	// The timestamp of resource creation (UTC).
	CreatedAt *time.Time

	// The identity that created the resource.
	CreatedBy *string

	// The type of identity that created the resource.
	CreatedByType *CreatedByType

	// The timestamp of resource modification (UTC).
	LastModifiedAt *time.Time

	// The identity that last modified the resource.
	LastModifiedBy *string

	// The type of identity that last modified the resource.
	LastModifiedByType *LastModifiedByType
}

SystemData - Metadata pertaining to creation and last modification of the resource.

func (SystemData) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type SystemData.

func (*SystemData) UnmarshalJSON

func (s *SystemData) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SystemData.

type TrackedResource

type TrackedResource struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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