armdeviceregistry

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 14 Imported by: 0

README

Azure Deviceregistry Module for Go

PkgGoDev

The armdeviceregistry module provides operations for working with Azure Deviceregistry.

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 Deviceregistry module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Deviceregistry. 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 Deviceregistry 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 := armdeviceregistry.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 := armdeviceregistry.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.NewAssetEndpointProfilesClient()

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 Deviceregistry 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 ActionType

type ActionType string

ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.

const (
	ActionTypeInternal ActionType = "Internal"
)

func PossibleActionTypeValues

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns the possible values for the ActionType const type.

type Asset

type Asset struct {
	// REQUIRED; The extended location.
	ExtendedLocation *ExtendedLocation

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

	// The resource-specific properties for this resource.
	Properties *AssetProperties

	// 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; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

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

Asset definition.

func (Asset) MarshalJSON

func (a Asset) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Asset.

func (*Asset) UnmarshalJSON

func (a *Asset) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Asset.

type AssetEndpointProfile

type AssetEndpointProfile struct {
	// REQUIRED; The extended location.
	ExtendedLocation *ExtendedLocation

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

	// The resource-specific properties for this resource.
	Properties *AssetEndpointProfileProperties

	// 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; Azure Resource Manager metadata containing createdBy and modifiedBy information.
	SystemData *SystemData

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

AssetEndpointProfile - Asset Endpoint Profile definition.

func (AssetEndpointProfile) MarshalJSON

func (a AssetEndpointProfile) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssetEndpointProfile.

func (*AssetEndpointProfile) UnmarshalJSON

func (a *AssetEndpointProfile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssetEndpointProfile.

type AssetEndpointProfileListResult

type AssetEndpointProfileListResult struct {
	// REQUIRED; The AssetEndpointProfile items on this page
	Value []*AssetEndpointProfile

	// The link to the next page of items
	NextLink *string
}

AssetEndpointProfileListResult - The response of a AssetEndpointProfile list operation.

func (AssetEndpointProfileListResult) MarshalJSON

func (a AssetEndpointProfileListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssetEndpointProfileListResult.

func (*AssetEndpointProfileListResult) UnmarshalJSON

func (a *AssetEndpointProfileListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssetEndpointProfileListResult.

type AssetEndpointProfileProperties

type AssetEndpointProfileProperties struct {
	// REQUIRED; The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress
	// URI specifies the type of the device. The additionalConfiguration field holds
	// further connector type specific configuration.
	TargetAddress *string

	// Contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF).
	AdditionalConfiguration *string

	// Defines the authentication mechanism for the southbound connector connecting to the shop floor/OT device.
	TransportAuthentication *TransportAuthentication

	// Defines the client authentication mechanism to the server.
	UserAuthentication *UserAuthentication

	// READ-ONLY; Provisioning state of the resource.
	ProvisioningState *ProvisioningState

	// READ-ONLY; Globally unique, immutable, non-reusable id.
	UUID *string
}

AssetEndpointProfileProperties - Defines the Asset Endpoint Profile properties.

func (AssetEndpointProfileProperties) MarshalJSON

func (a AssetEndpointProfileProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssetEndpointProfileProperties.

func (*AssetEndpointProfileProperties) UnmarshalJSON

func (a *AssetEndpointProfileProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssetEndpointProfileProperties.

type AssetEndpointProfileUpdate

type AssetEndpointProfileUpdate struct {
	// The updatable properties of the AssetEndpointProfile.
	Properties *AssetEndpointProfileUpdateProperties

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

AssetEndpointProfileUpdate - The type used for update operations of the AssetEndpointProfile.

func (AssetEndpointProfileUpdate) MarshalJSON

func (a AssetEndpointProfileUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssetEndpointProfileUpdate.

func (*AssetEndpointProfileUpdate) UnmarshalJSON

func (a *AssetEndpointProfileUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssetEndpointProfileUpdate.

type AssetEndpointProfileUpdateProperties

type AssetEndpointProfileUpdateProperties struct {
	// Contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF).
	AdditionalConfiguration *string

	// The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress
	// URI specifies the type of the device. The additionalConfiguration field holds
	// further connector type specific configuration.
	TargetAddress *string

	// Defines the authentication mechanism for the southbound connector connecting to the shop floor/OT device.
	TransportAuthentication *TransportAuthenticationUpdate

	// Defines the client authentication mechanism to the server.
	UserAuthentication *UserAuthenticationUpdate
}

AssetEndpointProfileUpdateProperties - The updatable properties of the AssetEndpointProfile.

func (AssetEndpointProfileUpdateProperties) MarshalJSON

func (a AssetEndpointProfileUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssetEndpointProfileUpdateProperties.

func (*AssetEndpointProfileUpdateProperties) UnmarshalJSON

func (a *AssetEndpointProfileUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssetEndpointProfileUpdateProperties.

type AssetEndpointProfilesClient

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

AssetEndpointProfilesClient contains the methods for the AssetEndpointProfiles group. Don't use this type directly, use NewAssetEndpointProfilesClient() instead.

func NewAssetEndpointProfilesClient

func NewAssetEndpointProfilesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssetEndpointProfilesClient, error)

NewAssetEndpointProfilesClient creates a new instance of AssetEndpointProfilesClient 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 (*AssetEndpointProfilesClient) BeginCreateOrReplace

BeginCreateOrReplace - Create a AssetEndpointProfile If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-11-01-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • assetEndpointProfileName - Asset Endpoint Profile name parameter.
  • resource - Resource create parameters.
  • options - AssetEndpointProfilesClientBeginCreateOrReplaceOptions contains the optional parameters for the AssetEndpointProfilesClient.BeginCreateOrReplace method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Create_AssetEndpointProfile.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/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAssetEndpointProfilesClient().BeginCreateOrReplace(ctx, "myResourceGroup", "my-assetendpointprofile", armdeviceregistry.AssetEndpointProfile{
		Location: to.Ptr("West Europe"),
		Tags: map[string]*string{
			"site": to.Ptr("building-1"),
		},
		ExtendedLocation: &armdeviceregistry.ExtendedLocation{
			Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
			Type: to.Ptr("CustomLocation"),
		},
		Properties: &armdeviceregistry.AssetEndpointProfileProperties{
			TargetAddress: to.Ptr("https://www.example.com/myTargetAddress"),
			UserAuthentication: &armdeviceregistry.UserAuthentication{
				Mode: to.Ptr(armdeviceregistry.UserAuthenticationModeAnonymous),
			},
		},
	}, 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.AssetEndpointProfile = armdeviceregistry.AssetEndpointProfile{
	// 	Name: to.Ptr("my-assetendpointprofile"),
	// 	Type: to.Ptr("Microsoft.DeviceRegistry/assetEndpointProfiles"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile"),
	// 	SystemData: &armdeviceregistry.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
	// 		CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 	},
	// 	Location: to.Ptr("West Europe"),
	// 	Tags: map[string]*string{
	// 		"site": to.Ptr("building-1"),
	// 	},
	// 	ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		Type: to.Ptr("CustomLocation"),
	// 	},
	// 	Properties: &armdeviceregistry.AssetEndpointProfileProperties{
	// 		ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		TargetAddress: to.Ptr("https://www.example.com/myTargetAddress"),
	// 		UserAuthentication: &armdeviceregistry.UserAuthentication{
	// 			Mode: to.Ptr(armdeviceregistry.UserAuthenticationModeAnonymous),
	// 		},
	// 		UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
	// 	},
	// }
}
Output:

func (*AssetEndpointProfilesClient) BeginDelete

BeginDelete - Delete a AssetEndpointProfile If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-11-01-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • assetEndpointProfileName - Asset Endpoint Profile name parameter.
  • options - AssetEndpointProfilesClientBeginDeleteOptions contains the optional parameters for the AssetEndpointProfilesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Delete_AssetEndpointProfile.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAssetEndpointProfilesClient().BeginDelete(ctx, "myResourceGroup", "my-assetendpointprofile", 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 (*AssetEndpointProfilesClient) BeginUpdate

BeginUpdate - Update a AssetEndpointProfile If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-11-01-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • assetEndpointProfileName - Asset Endpoint Profile name parameter.
  • properties - The resource properties to be updated.
  • options - AssetEndpointProfilesClientBeginUpdateOptions contains the optional parameters for the AssetEndpointProfilesClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Update_AssetEndpointProfile.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/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAssetEndpointProfilesClient().BeginUpdate(ctx, "myResourceGroup", "my-assetendpointprofile", armdeviceregistry.AssetEndpointProfileUpdate{
		Properties: &armdeviceregistry.AssetEndpointProfileUpdateProperties{
			TargetAddress: to.Ptr("https://www.example.com/myTargetAddress"),
		},
	}, 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.AssetEndpointProfile = armdeviceregistry.AssetEndpointProfile{
	// 	Name: to.Ptr("my-assetendpointprofile"),
	// 	Type: to.Ptr("Microsoft.DeviceRegistry/assetEndpointProfiles"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile"),
	// 	SystemData: &armdeviceregistry.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
	// 		CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 	},
	// 	Location: to.Ptr("West Europe"),
	// 	Tags: map[string]*string{
	// 		"site": to.Ptr("building-1"),
	// 	},
	// 	ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		Type: to.Ptr("CustomLocation"),
	// 	},
	// 	Properties: &armdeviceregistry.AssetEndpointProfileProperties{
	// 		ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		TargetAddress: to.Ptr("https://www.example.com/myTargetAddress"),
	// 		UserAuthentication: &armdeviceregistry.UserAuthentication{
	// 			Mode: to.Ptr(armdeviceregistry.UserAuthenticationModeAnonymous),
	// 		},
	// 		UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
	// 	},
	// }
}
Output:

func (*AssetEndpointProfilesClient) Get

func (client *AssetEndpointProfilesClient) Get(ctx context.Context, resourceGroupName string, assetEndpointProfileName string, options *AssetEndpointProfilesClientGetOptions) (AssetEndpointProfilesClientGetResponse, error)

Get - Get a AssetEndpointProfile If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-11-01-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • assetEndpointProfileName - Asset Endpoint Profile name parameter.
  • options - AssetEndpointProfilesClientGetOptions contains the optional parameters for the AssetEndpointProfilesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_AssetEndpointProfile.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAssetEndpointProfilesClient().Get(ctx, "myResourceGroup", "my-assetendpointprofile", 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.AssetEndpointProfile = armdeviceregistry.AssetEndpointProfile{
	// 	Name: to.Ptr("my-assetendpointprofile"),
	// 	Type: to.Ptr("Microsoft.DeviceRegistry/assetEndpointProfiles"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile"),
	// 	SystemData: &armdeviceregistry.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
	// 		CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 	},
	// 	Location: to.Ptr("West Europe"),
	// 	Tags: map[string]*string{
	// 		"site": to.Ptr("building-1"),
	// 	},
	// 	ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		Type: to.Ptr("CustomLocation"),
	// 	},
	// 	Properties: &armdeviceregistry.AssetEndpointProfileProperties{
	// 		ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		TargetAddress: to.Ptr("https://www.example.com/myTargetAddress"),
	// 		TransportAuthentication: &armdeviceregistry.TransportAuthentication{
	// 			OwnCertificates: []*armdeviceregistry.OwnCertificate{
	// 				{
	// 					CertPasswordReference: to.Ptr("passwordRef"),
	// 					CertSecretReference: to.Ptr("secretRef"),
	// 					CertThumbprint: to.Ptr("myThumbprint"),
	// 			}},
	// 		},
	// 		UserAuthentication: &armdeviceregistry.UserAuthentication{
	// 			Mode: to.Ptr(armdeviceregistry.UserAuthenticationModeUsernamePassword),
	// 			UsernamePasswordCredentials: &armdeviceregistry.UsernamePasswordCredentials{
	// 				PasswordReference: to.Ptr("passwordRef"),
	// 				UsernameReference: to.Ptr("usernameRef"),
	// 			},
	// 		},
	// 		UUID: to.Ptr("1824a74f-21e1-4458-ae07-604d3a241d2e"),
	// 	},
	// }
}
Output:

func (*AssetEndpointProfilesClient) NewListByResourceGroupPager

NewListByResourceGroupPager - List AssetEndpointProfile resources by resource group

Generated from API version 2023-11-01-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/List_AssetEndpointProfiles_ResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAssetEndpointProfilesClient().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.AssetEndpointProfileListResult = armdeviceregistry.AssetEndpointProfileListResult{
		// 	Value: []*armdeviceregistry.AssetEndpointProfile{
		// 		{
		// 			Name: to.Ptr("my-assetendpointprofile"),
		// 			Type: to.Ptr("Microsoft.DeviceRegistry/assetEndpointProfiles"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile"),
		// 			SystemData: &armdeviceregistry.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
		// 				CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 			},
		// 			Location: to.Ptr("West Europe"),
		// 			Tags: map[string]*string{
		// 				"site": to.Ptr("building-1"),
		// 			},
		// 			ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				Type: to.Ptr("CustomLocation"),
		// 			},
		// 			Properties: &armdeviceregistry.AssetEndpointProfileProperties{
		// 				ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				TargetAddress: to.Ptr("https://www.example.com/myTargetAddress"),
		// 				UserAuthentication: &armdeviceregistry.UserAuthentication{
		// 					Mode: to.Ptr(armdeviceregistry.UserAuthenticationModeAnonymous),
		// 				},
		// 				UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("my-assetendpointprofile1"),
		// 			Type: to.Ptr("Microsoft.DeviceRegistry/assetEndpointProfiles"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile1"),
		// 			SystemData: &armdeviceregistry.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
		// 				CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 			},
		// 			Location: to.Ptr("West Europe"),
		// 			Tags: map[string]*string{
		// 				"site": to.Ptr("building-2"),
		// 			},
		// 			ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				Type: to.Ptr("CustomLocation"),
		// 			},
		// 			Properties: &armdeviceregistry.AssetEndpointProfileProperties{
		// 				ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				TargetAddress: to.Ptr("https://www.example.com/myTargetAddress1"),
		// 				UserAuthentication: &armdeviceregistry.UserAuthentication{
		// 					Mode: to.Ptr(armdeviceregistry.UserAuthenticationModeCertificate),
		// 					X509Credentials: &armdeviceregistry.X509Credentials{
		// 						CertificateReference: to.Ptr("certificatRef"),
		// 					},
		// 				},
		// 				UUID: to.Ptr("7824a74f-21e1-4458-ae06-604d3a241d2c"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("my-assetendpointprofile2"),
		// 			Type: to.Ptr("Microsoft.DeviceRegistry/assetEndpointProfiles"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile2"),
		// 			SystemData: &armdeviceregistry.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
		// 				CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 			},
		// 			Location: to.Ptr("West Europe"),
		// 			Tags: map[string]*string{
		// 				"site": to.Ptr("building-2"),
		// 			},
		// 			ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				Type: to.Ptr("CustomLocation"),
		// 			},
		// 			Properties: &armdeviceregistry.AssetEndpointProfileProperties{
		// 				ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				TargetAddress: to.Ptr("https://www.example.com/myTargetAddress2"),
		// 				TransportAuthentication: &armdeviceregistry.TransportAuthentication{
		// 					OwnCertificates: []*armdeviceregistry.OwnCertificate{
		// 						{
		// 							CertPasswordReference: to.Ptr("passwordRef"),
		// 							CertSecretReference: to.Ptr("secretRef"),
		// 							CertThumbprint: to.Ptr("myThumbprint"),
		// 					}},
		// 				},
		// 				UserAuthentication: &armdeviceregistry.UserAuthentication{
		// 					Mode: to.Ptr(armdeviceregistry.UserAuthenticationModeUsernamePassword),
		// 					UsernamePasswordCredentials: &armdeviceregistry.UsernamePasswordCredentials{
		// 						PasswordReference: to.Ptr("passwordRef"),
		// 						UsernameReference: to.Ptr("usernameRef"),
		// 					},
		// 				},
		// 				UUID: to.Ptr("1824a74f-21e1-4458-ae07-604d3a241d2e"),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*AssetEndpointProfilesClient) NewListBySubscriptionPager

NewListBySubscriptionPager - List AssetEndpointProfile resources by subscription ID

Generated from API version 2023-11-01-preview

  • options - AssetEndpointProfilesClientListBySubscriptionOptions contains the optional parameters for the AssetEndpointProfilesClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/List_AssetEndpointProfiles_Subscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAssetEndpointProfilesClient().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.AssetEndpointProfileListResult = armdeviceregistry.AssetEndpointProfileListResult{
		// 	Value: []*armdeviceregistry.AssetEndpointProfile{
		// 		{
		// 			Name: to.Ptr("my-assetendpointprofile"),
		// 			Type: to.Ptr("Microsoft.DeviceRegistry/assetEndpointProfiles"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile"),
		// 			SystemData: &armdeviceregistry.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
		// 				CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 			},
		// 			Location: to.Ptr("West Europe"),
		// 			Tags: map[string]*string{
		// 				"site": to.Ptr("building-1"),
		// 			},
		// 			ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				Type: to.Ptr("CustomLocation"),
		// 			},
		// 			Properties: &armdeviceregistry.AssetEndpointProfileProperties{
		// 				ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				TargetAddress: to.Ptr("https://www.example.com/myTargetAddress"),
		// 				UserAuthentication: &armdeviceregistry.UserAuthentication{
		// 					Mode: to.Ptr(armdeviceregistry.UserAuthenticationModeAnonymous),
		// 				},
		// 				UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("my-assetendpointprofile1"),
		// 			Type: to.Ptr("Microsoft.DeviceRegistry/assetEndpointProfiles"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile1"),
		// 			SystemData: &armdeviceregistry.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
		// 				CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 			},
		// 			Location: to.Ptr("West Europe"),
		// 			Tags: map[string]*string{
		// 				"site": to.Ptr("building-2"),
		// 			},
		// 			ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				Type: to.Ptr("CustomLocation"),
		// 			},
		// 			Properties: &armdeviceregistry.AssetEndpointProfileProperties{
		// 				ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				TargetAddress: to.Ptr("https://www.example.com/myTargetAddress1"),
		// 				UserAuthentication: &armdeviceregistry.UserAuthentication{
		// 					Mode: to.Ptr(armdeviceregistry.UserAuthenticationModeCertificate),
		// 					X509Credentials: &armdeviceregistry.X509Credentials{
		// 						CertificateReference: to.Ptr("certificatRef"),
		// 					},
		// 				},
		// 				UUID: to.Ptr("7824a74f-21e1-4458-ae06-604d3a241d2c"),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("my-assetendpointprofile2"),
		// 			Type: to.Ptr("Microsoft.DeviceRegistry/assetEndpointProfiles"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/my-assetendpointprofile2"),
		// 			SystemData: &armdeviceregistry.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
		// 				CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 			},
		// 			Location: to.Ptr("West Europe"),
		// 			Tags: map[string]*string{
		// 				"site": to.Ptr("building-2"),
		// 			},
		// 			ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				Type: to.Ptr("CustomLocation"),
		// 			},
		// 			Properties: &armdeviceregistry.AssetEndpointProfileProperties{
		// 				ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				TargetAddress: to.Ptr("https://www.example.com/myTargetAddress2"),
		// 				TransportAuthentication: &armdeviceregistry.TransportAuthentication{
		// 					OwnCertificates: []*armdeviceregistry.OwnCertificate{
		// 						{
		// 							CertPasswordReference: to.Ptr("passwordRef"),
		// 							CertSecretReference: to.Ptr("secretRef"),
		// 							CertThumbprint: to.Ptr("myThumbprint"),
		// 					}},
		// 				},
		// 				UserAuthentication: &armdeviceregistry.UserAuthentication{
		// 					Mode: to.Ptr(armdeviceregistry.UserAuthenticationModeUsernamePassword),
		// 					UsernamePasswordCredentials: &armdeviceregistry.UsernamePasswordCredentials{
		// 						PasswordReference: to.Ptr("passwordRef"),
		// 						UsernameReference: to.Ptr("usernameRef"),
		// 					},
		// 				},
		// 				UUID: to.Ptr("1824a74f-21e1-4458-ae07-604d3a241d2e"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type AssetEndpointProfilesClientBeginCreateOrReplaceOptions

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

AssetEndpointProfilesClientBeginCreateOrReplaceOptions contains the optional parameters for the AssetEndpointProfilesClient.BeginCreateOrReplace method.

type AssetEndpointProfilesClientBeginDeleteOptions

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

AssetEndpointProfilesClientBeginDeleteOptions contains the optional parameters for the AssetEndpointProfilesClient.BeginDelete method.

type AssetEndpointProfilesClientBeginUpdateOptions

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

AssetEndpointProfilesClientBeginUpdateOptions contains the optional parameters for the AssetEndpointProfilesClient.BeginUpdate method.

type AssetEndpointProfilesClientCreateOrReplaceResponse

type AssetEndpointProfilesClientCreateOrReplaceResponse struct {
	// Asset Endpoint Profile definition.
	AssetEndpointProfile
}

AssetEndpointProfilesClientCreateOrReplaceResponse contains the response from method AssetEndpointProfilesClient.BeginCreateOrReplace.

type AssetEndpointProfilesClientDeleteResponse

type AssetEndpointProfilesClientDeleteResponse struct {
}

AssetEndpointProfilesClientDeleteResponse contains the response from method AssetEndpointProfilesClient.BeginDelete.

type AssetEndpointProfilesClientGetOptions

type AssetEndpointProfilesClientGetOptions struct {
}

AssetEndpointProfilesClientGetOptions contains the optional parameters for the AssetEndpointProfilesClient.Get method.

type AssetEndpointProfilesClientGetResponse

type AssetEndpointProfilesClientGetResponse struct {
	// Asset Endpoint Profile definition.
	AssetEndpointProfile
}

AssetEndpointProfilesClientGetResponse contains the response from method AssetEndpointProfilesClient.Get.

type AssetEndpointProfilesClientListByResourceGroupOptions

type AssetEndpointProfilesClientListByResourceGroupOptions struct {
}

AssetEndpointProfilesClientListByResourceGroupOptions contains the optional parameters for the AssetEndpointProfilesClient.NewListByResourceGroupPager method.

type AssetEndpointProfilesClientListByResourceGroupResponse

type AssetEndpointProfilesClientListByResourceGroupResponse struct {
	// The response of a AssetEndpointProfile list operation.
	AssetEndpointProfileListResult
}

AssetEndpointProfilesClientListByResourceGroupResponse contains the response from method AssetEndpointProfilesClient.NewListByResourceGroupPager.

type AssetEndpointProfilesClientListBySubscriptionOptions

type AssetEndpointProfilesClientListBySubscriptionOptions struct {
}

AssetEndpointProfilesClientListBySubscriptionOptions contains the optional parameters for the AssetEndpointProfilesClient.NewListBySubscriptionPager method.

type AssetEndpointProfilesClientListBySubscriptionResponse

type AssetEndpointProfilesClientListBySubscriptionResponse struct {
	// The response of a AssetEndpointProfile list operation.
	AssetEndpointProfileListResult
}

AssetEndpointProfilesClientListBySubscriptionResponse contains the response from method AssetEndpointProfilesClient.NewListBySubscriptionPager.

type AssetEndpointProfilesClientUpdateResponse

type AssetEndpointProfilesClientUpdateResponse struct {
	// Asset Endpoint Profile definition.
	AssetEndpointProfile
}

AssetEndpointProfilesClientUpdateResponse contains the response from method AssetEndpointProfilesClient.BeginUpdate.

type AssetListResult

type AssetListResult struct {
	// REQUIRED; The Asset items on this page
	Value []*Asset

	// The link to the next page of items
	NextLink *string
}

AssetListResult - The response of a Asset list operation.

func (AssetListResult) MarshalJSON

func (a AssetListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssetListResult.

func (*AssetListResult) UnmarshalJSON

func (a *AssetListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssetListResult.

type AssetProperties

type AssetProperties struct {
	// REQUIRED; A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint
	// that provides data points for this asset. Must have the format /.
	AssetEndpointProfileURI *string

	// Resource path to asset type (model) definition.
	AssetType *string

	// A set of key-value pairs that contain custom attributes set by the customer.
	Attributes map[string]any

	// Array of data points that are part of the asset. Each data point can reference an asset type capability and have per-data
	// point configuration. See below for more details for the definition of the
	// dataPoints element.
	DataPoints []*DataPoint

	// Protocol-specific default configuration for all data points. Each data point can have its own configuration that overrides
	// the default settings here. This assumes that each asset instance has one
	// protocol.
	DefaultDataPointsConfiguration *string

	// Protocol-specific default configuration for all events. Each event can have its own configuration that overrides the default
	// settings here. This assumes that each asset instance has one protocol.
	DefaultEventsConfiguration *string

	// Human-readable description of the asset.
	Description *string

	// Human-readable display name.
	DisplayName *string

	// Reference to the documentation.
	DocumentationURI *string

	// Enabled/Disabled status of the asset.
	Enabled *bool

	// Array of events that are part of the asset. Each event can reference an asset type capability and have per-event configuration.
	// See below for more details about the definition of the events element.
	Events []*Event

	// Asset id provided by the customer.
	ExternalAssetID *string

	// Revision number of the hardware.
	HardwareRevision *string

	// Asset manufacturer name.
	Manufacturer *string

	// Asset manufacturer URI.
	ManufacturerURI *string

	// Asset model name.
	Model *string

	// Asset product code.
	ProductCode *string

	// Asset serial number.
	SerialNumber *string

	// Revision number of the software.
	SoftwareRevision *string

	// READ-ONLY; Provisioning state of the resource.
	ProvisioningState *ProvisioningState

	// READ-ONLY; Read only object to reflect changes that have occurred on the Edge. Similar to Kubernetes status property for
	// custom resources.
	Status *AssetStatus

	// READ-ONLY; Globally unique, immutable, non-reusable id.
	UUID *string

	// READ-ONLY; An integer that is incremented each time the resource is modified.
	Version *int32
}

AssetProperties - Defines the asset properties.

func (AssetProperties) MarshalJSON

func (a AssetProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssetProperties.

func (*AssetProperties) UnmarshalJSON

func (a *AssetProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssetProperties.

type AssetStatus

type AssetStatus struct {
	// Array object to transfer and persist errors that originate from the Edge.
	Errors []*AssetStatusError

	// A read only incremental counter indicating the number of times the configuration has been modified from the perspective
	// of the current actual (Edge) state of the Asset. Edge would be the only writer
	// of this value and would sync back up to the cloud. In steady state, this should equal version.
	Version *int32
}

AssetStatus - Defines the asset status properties.

func (AssetStatus) MarshalJSON

func (a AssetStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssetStatus.

func (*AssetStatus) UnmarshalJSON

func (a *AssetStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssetStatus.

type AssetStatusError

type AssetStatusError struct {
	// Error code for classification of errors (ex: 400, 404, 500, etc.).
	Code *int32

	// Human readable helpful error message to provide additional context for error (ex: “capability Id 'foo' does not exist”).
	Message *string
}

AssetStatusError - Defines the asset status error properties.

func (AssetStatusError) MarshalJSON

func (a AssetStatusError) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssetStatusError.

func (*AssetStatusError) UnmarshalJSON

func (a *AssetStatusError) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssetStatusError.

type AssetUpdate

type AssetUpdate struct {
	// The updatable properties of the Asset.
	Properties *AssetUpdateProperties

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

AssetUpdate - The type used for update operations of the Asset.

func (AssetUpdate) MarshalJSON

func (a AssetUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssetUpdate.

func (*AssetUpdate) UnmarshalJSON

func (a *AssetUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssetUpdate.

type AssetUpdateProperties

type AssetUpdateProperties struct {
	// Resource path to asset type (model) definition.
	AssetType *string

	// A set of key-value pairs that contain custom attributes set by the customer.
	Attributes map[string]any

	// Array of data points that are part of the asset. Each data point can reference an asset type capability and have per-data
	// point configuration. See below for more details for the definition of the
	// dataPoints element.
	DataPoints []*DataPoint

	// Protocol-specific default configuration for all data points. Each data point can have its own configuration that overrides
	// the default settings here. This assumes that each asset instance has one
	// protocol.
	DefaultDataPointsConfiguration *string

	// Protocol-specific default configuration for all events. Each event can have its own configuration that overrides the default
	// settings here. This assumes that each asset instance has one protocol.
	DefaultEventsConfiguration *string

	// Human-readable description of the asset.
	Description *string

	// Human-readable display name.
	DisplayName *string

	// Reference to the documentation.
	DocumentationURI *string

	// Enabled/Disabled status of the asset.
	Enabled *bool

	// Array of events that are part of the asset. Each event can reference an asset type capability and have per-event configuration.
	// See below for more details about the definition of the events element.
	Events []*Event

	// Revision number of the hardware.
	HardwareRevision *string

	// Asset manufacturer name.
	Manufacturer *string

	// Asset manufacturer URI.
	ManufacturerURI *string

	// Asset model name.
	Model *string

	// Asset product code.
	ProductCode *string

	// Asset serial number.
	SerialNumber *string

	// Revision number of the software.
	SoftwareRevision *string
}

AssetUpdateProperties - The updatable properties of the Asset.

func (AssetUpdateProperties) MarshalJSON

func (a AssetUpdateProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AssetUpdateProperties.

func (*AssetUpdateProperties) UnmarshalJSON

func (a *AssetUpdateProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AssetUpdateProperties.

type AssetsClient

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

AssetsClient contains the methods for the Assets group. Don't use this type directly, use NewAssetsClient() instead.

func NewAssetsClient

func NewAssetsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssetsClient, error)

NewAssetsClient creates a new instance of AssetsClient 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 (*AssetsClient) BeginCreateOrReplace

func (client *AssetsClient) BeginCreateOrReplace(ctx context.Context, resourceGroupName string, assetName string, resource Asset, options *AssetsClientBeginCreateOrReplaceOptions) (*runtime.Poller[AssetsClientCreateOrReplaceResponse], error)

BeginCreateOrReplace - Create a Asset If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-11-01-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • assetName - Asset name parameter.
  • resource - Resource create parameters.
  • options - AssetsClientBeginCreateOrReplaceOptions contains the optional parameters for the AssetsClient.BeginCreateOrReplace method.
Example (CreateAnAssetWithExternalAssetId)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Create_Asset_With_ExternalAssetId.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/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAssetsClient().BeginCreateOrReplace(ctx, "myResourceGroup", "my-asset", armdeviceregistry.Asset{
		Location: to.Ptr("West Europe"),
		Tags: map[string]*string{
			"site": to.Ptr("building-1"),
		},
		ExtendedLocation: &armdeviceregistry.ExtendedLocation{
			Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
			Type: to.Ptr("CustomLocation"),
		},
		Properties: &armdeviceregistry.AssetProperties{
			Description:             to.Ptr("This is a sample Asset"),
			AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile"),
			AssetType:               to.Ptr("MyAssetType"),
			DataPoints: []*armdeviceregistry.DataPoint{
				{
					CapabilityID:           to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
					DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
					DataSource:             to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
					ObservabilityMode:      to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
				},
				{
					CapabilityID:           to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
					DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
					DataSource:             to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
					ObservabilityMode:      to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
				}},
			DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
			DefaultEventsConfiguration:     to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
			DisplayName:                    to.Ptr("AssetDisplayName"),
			DocumentationURI:               to.Ptr("https://www.example.com/manual"),
			Enabled:                        to.Ptr(true),
			Events: []*armdeviceregistry.Event{
				{
					CapabilityID:       to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
					EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
					EventNotifier:      to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
					ObservabilityMode:  to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
				},
				{
					CapabilityID:       to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
					EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
					EventNotifier:      to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
					ObservabilityMode:  to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
				}},
			ExternalAssetID:  to.Ptr("8ZBA6LRHU0A458969"),
			HardwareRevision: to.Ptr("1.0"),
			Manufacturer:     to.Ptr("Contoso"),
			ManufacturerURI:  to.Ptr("https://www.contoso.com/manufacturerUri"),
			Model:            to.Ptr("ContosoModel"),
			ProductCode:      to.Ptr("SA34VDG"),
			SerialNumber:     to.Ptr("64-103816-519918-8"),
			SoftwareRevision: to.Ptr("2.0"),
		},
	}, 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.Asset = armdeviceregistry.Asset{
	// 	Name: to.Ptr("my-asset"),
	// 	Type: to.Ptr("Microsoft.DeviceRegistry/assets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset"),
	// 	SystemData: &armdeviceregistry.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
	// 		CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 	},
	// 	Location: to.Ptr("West Europe"),
	// 	Tags: map[string]*string{
	// 		"site": to.Ptr("building-1"),
	// 	},
	// 	ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		Type: to.Ptr("CustomLocation"),
	// 	},
	// 	Properties: &armdeviceregistry.AssetProperties{
	// 		Description: to.Ptr("This is a sample Asset"),
	// 		AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile"),
	// 		AssetType: to.Ptr("MyAssetType"),
	// 		DataPoints: []*armdeviceregistry.DataPoint{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
	// 		}},
	// 		DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DefaultEventsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DisplayName: to.Ptr("AssetDisplayName"),
	// 		DocumentationURI: to.Ptr("https://www.example.com/manual"),
	// 		Enabled: to.Ptr(true),
	// 		Events: []*armdeviceregistry.Event{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
	// 		}},
	// 		ExternalAssetID: to.Ptr("8ZBA6LRHU0A458969"),
	// 		HardwareRevision: to.Ptr("1.0"),
	// 		Manufacturer: to.Ptr("Contoso"),
	// 		ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
	// 		Model: to.Ptr("ContosoModel"),
	// 		ProductCode: to.Ptr("SA34VDG"),
	// 		ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		SerialNumber: to.Ptr("64-103816-519918-8"),
	// 		SoftwareRevision: to.Ptr("2.0"),
	// 		UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
	// 		Version: to.Ptr[int32](73766),
	// 	},
	// }
}
Output:

Example (CreateAnAssetWithoutDisplayName)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Create_Asset_Without_DisplayName.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/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAssetsClient().BeginCreateOrReplace(ctx, "myResourceGroup", "my-asset", armdeviceregistry.Asset{
		Location: to.Ptr("West Europe"),
		Tags: map[string]*string{
			"site": to.Ptr("building-1"),
		},
		ExtendedLocation: &armdeviceregistry.ExtendedLocation{
			Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
			Type: to.Ptr("CustomLocation"),
		},
		Properties: &armdeviceregistry.AssetProperties{
			Description:             to.Ptr("This is a sample Asset"),
			AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile"),
			AssetType:               to.Ptr("MyAssetType"),
			DataPoints: []*armdeviceregistry.DataPoint{
				{
					CapabilityID:           to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
					DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
					DataSource:             to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
					ObservabilityMode:      to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
				},
				{
					CapabilityID:           to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
					DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
					DataSource:             to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
					ObservabilityMode:      to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
				}},
			DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
			DefaultEventsConfiguration:     to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
			DocumentationURI:               to.Ptr("https://www.example.com/manual"),
			Enabled:                        to.Ptr(true),
			Events: []*armdeviceregistry.Event{
				{
					CapabilityID:       to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
					EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
					EventNotifier:      to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
					ObservabilityMode:  to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
				},
				{
					CapabilityID:       to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
					EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
					EventNotifier:      to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
					ObservabilityMode:  to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
				}},
			ExternalAssetID:  to.Ptr("8ZBA6LRHU0A458969"),
			HardwareRevision: to.Ptr("1.0"),
			Manufacturer:     to.Ptr("Contoso"),
			ManufacturerURI:  to.Ptr("https://www.contoso.com/manufacturerUri"),
			Model:            to.Ptr("ContosoModel"),
			ProductCode:      to.Ptr("SA34VDG"),
			SerialNumber:     to.Ptr("64-103816-519918-8"),
			SoftwareRevision: to.Ptr("2.0"),
		},
	}, 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.Asset = armdeviceregistry.Asset{
	// 	Name: to.Ptr("my-asset"),
	// 	Type: to.Ptr("Microsoft.DeviceRegistry/assets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset"),
	// 	SystemData: &armdeviceregistry.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
	// 		CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 	},
	// 	Location: to.Ptr("West Europe"),
	// 	Tags: map[string]*string{
	// 		"site": to.Ptr("building-1"),
	// 	},
	// 	ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		Type: to.Ptr("CustomLocation"),
	// 	},
	// 	Properties: &armdeviceregistry.AssetProperties{
	// 		Description: to.Ptr("This is a sample Asset"),
	// 		AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile"),
	// 		AssetType: to.Ptr("MyAssetType"),
	// 		DataPoints: []*armdeviceregistry.DataPoint{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
	// 		}},
	// 		DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DefaultEventsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DisplayName: to.Ptr("myAsset"),
	// 		DocumentationURI: to.Ptr("https://www.example.com/manual"),
	// 		Enabled: to.Ptr(true),
	// 		Events: []*armdeviceregistry.Event{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
	// 		}},
	// 		ExternalAssetID: to.Ptr("8ZBA6LRHU0A458969"),
	// 		HardwareRevision: to.Ptr("1.0"),
	// 		Manufacturer: to.Ptr("Contoso"),
	// 		ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
	// 		Model: to.Ptr("ContosoModel"),
	// 		ProductCode: to.Ptr("SA34VDG"),
	// 		ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		SerialNumber: to.Ptr("64-103816-519918-8"),
	// 		SoftwareRevision: to.Ptr("2.0"),
	// 		UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
	// 		Version: to.Ptr[int32](73766),
	// 	},
	// }
}
Output:

Example (CreateAnAssetWithoutExternalAssetId)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Create_Asset_Without_ExternalAssetId.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/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAssetsClient().BeginCreateOrReplace(ctx, "myResourceGroup", "my-asset", armdeviceregistry.Asset{
		Location: to.Ptr("West Europe"),
		Tags: map[string]*string{
			"site": to.Ptr("building-1"),
		},
		ExtendedLocation: &armdeviceregistry.ExtendedLocation{
			Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
			Type: to.Ptr("CustomLocation"),
		},
		Properties: &armdeviceregistry.AssetProperties{
			Description:             to.Ptr("This is a sample Asset"),
			AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile"),
			AssetType:               to.Ptr("MyAssetType"),
			DataPoints: []*armdeviceregistry.DataPoint{
				{
					CapabilityID:           to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
					DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
					DataSource:             to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
					ObservabilityMode:      to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
				},
				{
					CapabilityID:           to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
					DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
					DataSource:             to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
					ObservabilityMode:      to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
				}},
			DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
			DefaultEventsConfiguration:     to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
			DisplayName:                    to.Ptr("AssetDisplayName"),
			DocumentationURI:               to.Ptr("https://www.example.com/manual"),
			Enabled:                        to.Ptr(true),
			Events: []*armdeviceregistry.Event{
				{
					CapabilityID:       to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
					EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
					EventNotifier:      to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
					ObservabilityMode:  to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
				},
				{
					CapabilityID:       to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
					EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
					EventNotifier:      to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
					ObservabilityMode:  to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
				}},
			HardwareRevision: to.Ptr("1.0"),
			Manufacturer:     to.Ptr("Contoso"),
			ManufacturerURI:  to.Ptr("https://www.contoso.com/manufacturerUri"),
			Model:            to.Ptr("ContosoModel"),
			ProductCode:      to.Ptr("SA34VDG"),
			SerialNumber:     to.Ptr("64-103816-519918-8"),
			SoftwareRevision: to.Ptr("2.0"),
		},
	}, 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.Asset = armdeviceregistry.Asset{
	// 	Name: to.Ptr("my-asset"),
	// 	Type: to.Ptr("Microsoft.DeviceRegistry/assets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset"),
	// 	SystemData: &armdeviceregistry.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
	// 		CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 	},
	// 	Location: to.Ptr("West Europe"),
	// 	Tags: map[string]*string{
	// 		"site": to.Ptr("building-1"),
	// 	},
	// 	ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		Type: to.Ptr("CustomLocation"),
	// 	},
	// 	Properties: &armdeviceregistry.AssetProperties{
	// 		Description: to.Ptr("This is a sample Asset"),
	// 		AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile"),
	// 		AssetType: to.Ptr("MyAssetType"),
	// 		DataPoints: []*armdeviceregistry.DataPoint{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
	// 		}},
	// 		DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DefaultEventsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DisplayName: to.Ptr("AssetDisplayName"),
	// 		DocumentationURI: to.Ptr("https://www.example.com/manual"),
	// 		Enabled: to.Ptr(true),
	// 		Events: []*armdeviceregistry.Event{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
	// 		}},
	// 		ExternalAssetID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
	// 		HardwareRevision: to.Ptr("1.0"),
	// 		Manufacturer: to.Ptr("Contoso"),
	// 		ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
	// 		Model: to.Ptr("ContosoModel"),
	// 		ProductCode: to.Ptr("SA34VDG"),
	// 		ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		SerialNumber: to.Ptr("64-103816-519918-8"),
	// 		SoftwareRevision: to.Ptr("2.0"),
	// 		UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
	// 		Version: to.Ptr[int32](73766),
	// 	},
	// }
}
Output:

func (*AssetsClient) BeginDelete

func (client *AssetsClient) BeginDelete(ctx context.Context, resourceGroupName string, assetName string, options *AssetsClientBeginDeleteOptions) (*runtime.Poller[AssetsClientDeleteResponse], error)

BeginDelete - Delete a Asset If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-11-01-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • assetName - Asset name parameter.
  • options - AssetsClientBeginDeleteOptions contains the optional parameters for the AssetsClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Delete_Asset.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAssetsClient().BeginDelete(ctx, "myResourceGroup", "my-asset", 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 (*AssetsClient) BeginUpdate

func (client *AssetsClient) BeginUpdate(ctx context.Context, resourceGroupName string, assetName string, properties AssetUpdate, options *AssetsClientBeginUpdateOptions) (*runtime.Poller[AssetsClientUpdateResponse], error)

BeginUpdate - Update a Asset If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-11-01-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • assetName - Asset name parameter.
  • properties - The resource properties to be updated.
  • options - AssetsClientBeginUpdateOptions contains the optional parameters for the AssetsClient.BeginUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Update_Asset.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/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	poller, err := clientFactory.NewAssetsClient().BeginUpdate(ctx, "myResourceGroup", "my-asset", armdeviceregistry.AssetUpdate{
		Properties: &armdeviceregistry.AssetUpdateProperties{
			DisplayName: to.Ptr("NewAssetDisplayName"),
			Enabled:     to.Ptr(false),
		},
	}, 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.Asset = armdeviceregistry.Asset{
	// 	Name: to.Ptr("my-asset"),
	// 	Type: to.Ptr("Microsoft.DeviceRegistry/assets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset"),
	// 	SystemData: &armdeviceregistry.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
	// 		CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 	},
	// 	Location: to.Ptr("West Europe"),
	// 	Tags: map[string]*string{
	// 		"site": to.Ptr("building-1"),
	// 	},
	// 	ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		Type: to.Ptr("CustomLocation"),
	// 	},
	// 	Properties: &armdeviceregistry.AssetProperties{
	// 		Description: to.Ptr("This is a sample Asset"),
	// 		AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile"),
	// 		AssetType: to.Ptr("MyAssetType"),
	// 		DataPoints: []*armdeviceregistry.DataPoint{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
	// 		}},
	// 		DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DefaultEventsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DisplayName: to.Ptr("NewAssetDisplayName"),
	// 		DocumentationURI: to.Ptr("https://www.example.com/manual"),
	// 		Enabled: to.Ptr(true),
	// 		Events: []*armdeviceregistry.Event{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
	// 		}},
	// 		ExternalAssetID: to.Ptr("8ZBA6LRHU0A458969"),
	// 		HardwareRevision: to.Ptr("1.0"),
	// 		Manufacturer: to.Ptr("Contoso"),
	// 		ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
	// 		Model: to.Ptr("ContosoModel"),
	// 		ProductCode: to.Ptr("SA34VDG"),
	// 		ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		SerialNumber: to.Ptr("64-103816-519918-8"),
	// 		SoftwareRevision: to.Ptr("2.0"),
	// 		UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
	// 		Version: to.Ptr[int32](73766),
	// 	},
	// }
}
Output:

func (*AssetsClient) Get

func (client *AssetsClient) Get(ctx context.Context, resourceGroupName string, assetName string, options *AssetsClientGetOptions) (AssetsClientGetResponse, error)

Get - Get a Asset If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-11-01-preview

  • resourceGroupName - The name of the resource group. The name is case insensitive.
  • assetName - Asset name parameter.
  • options - AssetsClientGetOptions contains the optional parameters for the AssetsClient.Get method.
Example (GetAnAsset)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_Asset.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAssetsClient().Get(ctx, "myResourceGroup", "my-asset", 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.Asset = armdeviceregistry.Asset{
	// 	Name: to.Ptr("my-asset"),
	// 	Type: to.Ptr("Microsoft.DeviceRegistry/assets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset"),
	// 	SystemData: &armdeviceregistry.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
	// 		CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 	},
	// 	Location: to.Ptr("West Europe"),
	// 	Tags: map[string]*string{
	// 		"site": to.Ptr("building-1"),
	// 	},
	// 	ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		Type: to.Ptr("CustomLocation"),
	// 	},
	// 	Properties: &armdeviceregistry.AssetProperties{
	// 		Description: to.Ptr("This is a sample Asset"),
	// 		AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile"),
	// 		AssetType: to.Ptr("MyAssetType"),
	// 		DataPoints: []*armdeviceregistry.DataPoint{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
	// 		}},
	// 		DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DefaultEventsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DisplayName: to.Ptr("AssetDisplayName"),
	// 		DocumentationURI: to.Ptr("https://www.example.com/manual"),
	// 		Enabled: to.Ptr(true),
	// 		Events: []*armdeviceregistry.Event{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
	// 		}},
	// 		ExternalAssetID: to.Ptr("8ZBA6LRHU0A458969"),
	// 		HardwareRevision: to.Ptr("1.0"),
	// 		Manufacturer: to.Ptr("Contoso"),
	// 		ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
	// 		Model: to.Ptr("ContosoModel"),
	// 		ProductCode: to.Ptr("SA34VDG"),
	// 		ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		SerialNumber: to.Ptr("64-103816-519918-8"),
	// 		SoftwareRevision: to.Ptr("2.0"),
	// 		UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
	// 		Version: to.Ptr[int32](73766),
	// 	},
	// }
}
Output:

Example (GetAnAssetWithSyncStatus)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_Asset_With_SyncStatus.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewAssetsClient().Get(ctx, "myResourceGroup", "my-asset", 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.Asset = armdeviceregistry.Asset{
	// 	Name: to.Ptr("my-asset"),
	// 	Type: to.Ptr("Microsoft.DeviceRegistry/assets"),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset"),
	// 	SystemData: &armdeviceregistry.SystemData{
	// 		CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
	// 		CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 		LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
	// 		LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
	// 		LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
	// 	},
	// 	Location: to.Ptr("West Europe"),
	// 	Tags: map[string]*string{
	// 		"site": to.Ptr("building-1"),
	// 	},
	// 	ExtendedLocation: &armdeviceregistry.ExtendedLocation{
	// 		Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
	// 		Type: to.Ptr("CustomLocation"),
	// 	},
	// 	Properties: &armdeviceregistry.AssetProperties{
	// 		Description: to.Ptr("This is a sample Asset"),
	// 		AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile"),
	// 		AssetType: to.Ptr("MyAssetType"),
	// 		DataPoints: []*armdeviceregistry.DataPoint{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
	// 				DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
	// 		}},
	// 		DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DefaultEventsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
	// 		DisplayName: to.Ptr("AssetDisplayName"),
	// 		DocumentationURI: to.Ptr("https://www.example.com/manual"),
	// 		Enabled: to.Ptr(true),
	// 		Events: []*armdeviceregistry.Event{
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
	// 			},
	// 			{
	// 				CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
	// 				EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
	// 				EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
	// 				ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
	// 		}},
	// 		ExternalAssetID: to.Ptr("8ZBA6LRHU0A458969"),
	// 		HardwareRevision: to.Ptr("1.0"),
	// 		Manufacturer: to.Ptr("Contoso"),
	// 		ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
	// 		Model: to.Ptr("ContosoModel"),
	// 		ProductCode: to.Ptr("SA34VDG"),
	// 		ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
	// 		SerialNumber: to.Ptr("64-103816-519918-8"),
	// 		SoftwareRevision: to.Ptr("2.0"),
	// 		Status: &armdeviceregistry.AssetStatus{
	// 			Errors: []*armdeviceregistry.AssetStatusError{
	// 				{
	// 					Code: to.Ptr[int32](500),
	// 					Message: to.Ptr("Internal Server Error"),
	// 			}},
	// 			Version: to.Ptr[int32](1),
	// 		},
	// 		UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
	// 		Version: to.Ptr[int32](73766),
	// 	},
	// }
}
Output:

func (*AssetsClient) NewListByResourceGroupPager

func (client *AssetsClient) NewListByResourceGroupPager(resourceGroupName string, options *AssetsClientListByResourceGroupOptions) *runtime.Pager[AssetsClientListByResourceGroupResponse]

NewListByResourceGroupPager - List Asset resources by resource group

Generated from API version 2023-11-01-preview

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

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/List_Assets_ResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAssetsClient().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.AssetListResult = armdeviceregistry.AssetListResult{
		// 	Value: []*armdeviceregistry.Asset{
		// 		{
		// 			Name: to.Ptr("my-asset"),
		// 			Type: to.Ptr("Microsoft.DeviceRegistry/assets"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset"),
		// 			SystemData: &armdeviceregistry.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
		// 				CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 			},
		// 			Location: to.Ptr("West Europe"),
		// 			Tags: map[string]*string{
		// 				"site": to.Ptr("building-1"),
		// 			},
		// 			ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				Type: to.Ptr("CustomLocation"),
		// 			},
		// 			Properties: &armdeviceregistry.AssetProperties{
		// 				Description: to.Ptr("This is a sample Asset"),
		// 				AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile"),
		// 				AssetType: to.Ptr("MyAssetType"),
		// 				DataPoints: []*armdeviceregistry.DataPoint{
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
		// 						DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
		// 						DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
		// 					},
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
		// 						DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
		// 						DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
		// 				}},
		// 				DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 				DefaultEventsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 				DisplayName: to.Ptr("AssetDisplayName"),
		// 				DocumentationURI: to.Ptr("https://www.example.com/manual"),
		// 				Enabled: to.Ptr(true),
		// 				Events: []*armdeviceregistry.Event{
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
		// 						EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
		// 						EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
		// 					},
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
		// 						EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
		// 						EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
		// 				}},
		// 				ExternalAssetID: to.Ptr("8ZBA6LRHU0A458969"),
		// 				HardwareRevision: to.Ptr("1.0"),
		// 				Manufacturer: to.Ptr("Contoso"),
		// 				ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
		// 				Model: to.Ptr("ContosoModel"),
		// 				ProductCode: to.Ptr("SA34VDG"),
		// 				ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				SerialNumber: to.Ptr("64-103816-519918-8"),
		// 				SoftwareRevision: to.Ptr("2.0"),
		// 				UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
		// 				Version: to.Ptr[int32](73766),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("my-asset1"),
		// 			Type: to.Ptr("Microsoft.DeviceRegistry/assets"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset1"),
		// 			SystemData: &armdeviceregistry.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
		// 				CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 			},
		// 			Location: to.Ptr("West Europe"),
		// 			Tags: map[string]*string{
		// 				"site": to.Ptr("building-2"),
		// 			},
		// 			ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				Type: to.Ptr("CustomLocation"),
		// 			},
		// 			Properties: &armdeviceregistry.AssetProperties{
		// 				Description: to.Ptr("This is a sample Asset 1"),
		// 				AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile1"),
		// 				AssetType: to.Ptr("MyAssetType"),
		// 				DataPoints: []*armdeviceregistry.DataPoint{
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
		// 						DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
		// 						DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt10"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
		// 					},
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
		// 						DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
		// 						DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt20"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
		// 				}},
		// 				DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 				DefaultEventsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 				DisplayName: to.Ptr("AssetDisplayName 1"),
		// 				DocumentationURI: to.Ptr("https://www.example.com/manual"),
		// 				Enabled: to.Ptr(true),
		// 				Events: []*armdeviceregistry.Event{
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
		// 						EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
		// 						EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt30"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
		// 					},
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
		// 						EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
		// 						EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt40"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
		// 				}},
		// 				ExternalAssetID: to.Ptr("9AVD7KLPU03377981"),
		// 				HardwareRevision: to.Ptr("1.0"),
		// 				Manufacturer: to.Ptr("Contoso"),
		// 				ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
		// 				Model: to.Ptr("ContosoModel"),
		// 				ProductCode: to.Ptr("SA34VDG"),
		// 				ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				SerialNumber: to.Ptr("12-984302-792341-8"),
		// 				SoftwareRevision: to.Ptr("2.0"),
		// 				UUID: to.Ptr("7824a74f-21e1-4458-ae06-604d3a241d2c"),
		// 				Version: to.Ptr[int32](73766),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*AssetsClient) NewListBySubscriptionPager

NewListBySubscriptionPager - List Asset resources by subscription ID

Generated from API version 2023-11-01-preview

  • options - AssetsClientListBySubscriptionOptions contains the optional parameters for the AssetsClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/List_Assets_Subscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	pager := clientFactory.NewAssetsClient().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.AssetListResult = armdeviceregistry.AssetListResult{
		// 	Value: []*armdeviceregistry.Asset{
		// 		{
		// 			Name: to.Ptr("my-asset"),
		// 			Type: to.Ptr("Microsoft.DeviceRegistry/assets"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset"),
		// 			SystemData: &armdeviceregistry.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
		// 				CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 			},
		// 			Location: to.Ptr("West Europe"),
		// 			Tags: map[string]*string{
		// 				"site": to.Ptr("building-1"),
		// 			},
		// 			ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				Type: to.Ptr("CustomLocation"),
		// 			},
		// 			Properties: &armdeviceregistry.AssetProperties{
		// 				Description: to.Ptr("This is a sample Asset"),
		// 				AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile"),
		// 				AssetType: to.Ptr("MyAssetType"),
		// 				DataPoints: []*armdeviceregistry.DataPoint{
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
		// 						DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
		// 						DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
		// 					},
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
		// 						DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
		// 						DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
		// 				}},
		// 				DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 				DefaultEventsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 				DisplayName: to.Ptr("AssetDisplayName"),
		// 				DocumentationURI: to.Ptr("https://www.example.com/manual"),
		// 				Enabled: to.Ptr(true),
		// 				Events: []*armdeviceregistry.Event{
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
		// 						EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
		// 						EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
		// 					},
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
		// 						EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
		// 						EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
		// 				}},
		// 				ExternalAssetID: to.Ptr("8ZBA6LRHU0A458969"),
		// 				HardwareRevision: to.Ptr("1.0"),
		// 				Manufacturer: to.Ptr("Contoso"),
		// 				ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
		// 				Model: to.Ptr("ContosoModel"),
		// 				ProductCode: to.Ptr("SA34VDG"),
		// 				ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				SerialNumber: to.Ptr("64-103816-519918-8"),
		// 				SoftwareRevision: to.Ptr("2.0"),
		// 				UUID: to.Ptr("0796f7c1-f2c8-44d7-9f5b-9a6f9522a85d"),
		// 				Version: to.Ptr[int32](73766),
		// 			},
		// 		},
		// 		{
		// 			Name: to.Ptr("my-asset1"),
		// 			Type: to.Ptr("Microsoft.DeviceRegistry/assets"),
		// 			ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DeviceRegistry/assets/my-asset1"),
		// 			SystemData: &armdeviceregistry.SystemData{
		// 				CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T00:36:43.251Z"); return t}()),
		// 				CreatedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				CreatedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 				LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-16T01:37:16.092Z"); return t}()),
		// 				LastModifiedBy: to.Ptr("2ta23112-4596-44ff-b773-19405922bfc1"),
		// 				LastModifiedByType: to.Ptr(armdeviceregistry.CreatedByTypeApplication),
		// 			},
		// 			Location: to.Ptr("West Europe"),
		// 			Tags: map[string]*string{
		// 				"site": to.Ptr("building-2"),
		// 			},
		// 			ExtendedLocation: &armdeviceregistry.ExtendedLocation{
		// 				Name: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1"),
		// 				Type: to.Ptr("CustomLocation"),
		// 			},
		// 			Properties: &armdeviceregistry.AssetProperties{
		// 				Description: to.Ptr("This is a sample Asset 1"),
		// 				AssetEndpointProfileURI: to.Ptr("https://www.example.com/myAssetEndpointProfile1"),
		// 				AssetType: to.Ptr("MyAssetType"),
		// 				DataPoints: []*armdeviceregistry.DataPoint{
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
		// 						DataPointConfiguration: to.Ptr("{\"publishingInterval\":8,\"samplingInterval\":8,\"queueSize\":4}"),
		// 						DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt10"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeCounter),
		// 					},
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
		// 						DataPointConfiguration: to.Ptr("{\"publishingInterval\":4,\"samplingInterval\":4,\"queueSize\":7}"),
		// 						DataSource: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt20"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.DataPointsObservabilityModeNone),
		// 				}},
		// 				DefaultDataPointsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 				DefaultEventsConfiguration: to.Ptr("{\"publishingInterval\":10,\"samplingInterval\":15,\"queueSize\":20}"),
		// 				DisplayName: to.Ptr("AssetDisplayName 1"),
		// 				DocumentationURI: to.Ptr("https://www.example.com/manual"),
		// 				Enabled: to.Ptr(true),
		// 				Events: []*armdeviceregistry.Event{
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__temperature;1"),
		// 						EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":1,\"queueSize\":8}"),
		// 						EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt30"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeNone),
		// 					},
		// 					{
		// 						CapabilityID: to.Ptr("dtmi:com:example:Thermostat:__pressure;1"),
		// 						EventConfiguration: to.Ptr("{\"publishingInterval\":7,\"samplingInterval\":8,\"queueSize\":4}"),
		// 						EventNotifier: to.Ptr("nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt40"),
		// 						ObservabilityMode: to.Ptr(armdeviceregistry.EventsObservabilityModeLog),
		// 				}},
		// 				ExternalAssetID: to.Ptr("9AVD7KLPU03377981"),
		// 				HardwareRevision: to.Ptr("1.0"),
		// 				Manufacturer: to.Ptr("Contoso"),
		// 				ManufacturerURI: to.Ptr("https://www.contoso.com/manufacturerUri"),
		// 				Model: to.Ptr("ContosoModel"),
		// 				ProductCode: to.Ptr("SA34VDG"),
		// 				ProvisioningState: to.Ptr(armdeviceregistry.ProvisioningStateSucceeded),
		// 				SerialNumber: to.Ptr("12-984302-792341-8"),
		// 				SoftwareRevision: to.Ptr("2.0"),
		// 				UUID: to.Ptr("7824a74f-21e1-4458-ae06-604d3a241d2c"),
		// 				Version: to.Ptr[int32](73766),
		// 			},
		// 	}},
		// }
	}
}
Output:

type AssetsClientBeginCreateOrReplaceOptions

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

AssetsClientBeginCreateOrReplaceOptions contains the optional parameters for the AssetsClient.BeginCreateOrReplace method.

type AssetsClientBeginDeleteOptions

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

AssetsClientBeginDeleteOptions contains the optional parameters for the AssetsClient.BeginDelete method.

type AssetsClientBeginUpdateOptions

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

AssetsClientBeginUpdateOptions contains the optional parameters for the AssetsClient.BeginUpdate method.

type AssetsClientCreateOrReplaceResponse

type AssetsClientCreateOrReplaceResponse struct {
	// Asset definition.
	Asset
}

AssetsClientCreateOrReplaceResponse contains the response from method AssetsClient.BeginCreateOrReplace.

type AssetsClientDeleteResponse

type AssetsClientDeleteResponse struct {
}

AssetsClientDeleteResponse contains the response from method AssetsClient.BeginDelete.

type AssetsClientGetOptions

type AssetsClientGetOptions struct {
}

AssetsClientGetOptions contains the optional parameters for the AssetsClient.Get method.

type AssetsClientGetResponse

type AssetsClientGetResponse struct {
	// Asset definition.
	Asset
}

AssetsClientGetResponse contains the response from method AssetsClient.Get.

type AssetsClientListByResourceGroupOptions

type AssetsClientListByResourceGroupOptions struct {
}

AssetsClientListByResourceGroupOptions contains the optional parameters for the AssetsClient.NewListByResourceGroupPager method.

type AssetsClientListByResourceGroupResponse

type AssetsClientListByResourceGroupResponse struct {
	// The response of a Asset list operation.
	AssetListResult
}

AssetsClientListByResourceGroupResponse contains the response from method AssetsClient.NewListByResourceGroupPager.

type AssetsClientListBySubscriptionOptions

type AssetsClientListBySubscriptionOptions struct {
}

AssetsClientListBySubscriptionOptions contains the optional parameters for the AssetsClient.NewListBySubscriptionPager method.

type AssetsClientListBySubscriptionResponse

type AssetsClientListBySubscriptionResponse struct {
	// The response of a Asset list operation.
	AssetListResult
}

AssetsClientListBySubscriptionResponse contains the response from method AssetsClient.NewListBySubscriptionPager.

type AssetsClientUpdateResponse

type AssetsClientUpdateResponse struct {
	// Asset definition.
	Asset
}

AssetsClientUpdateResponse contains the response from method AssetsClient.BeginUpdate.

type ClientFactory

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

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) NewAssetEndpointProfilesClient

func (c *ClientFactory) NewAssetEndpointProfilesClient() *AssetEndpointProfilesClient

NewAssetEndpointProfilesClient creates a new instance of AssetEndpointProfilesClient.

func (*ClientFactory) NewAssetsClient

func (c *ClientFactory) NewAssetsClient() *AssetsClient

NewAssetsClient creates a new instance of AssetsClient.

func (*ClientFactory) NewOperationStatusClient

func (c *ClientFactory) NewOperationStatusClient() *OperationStatusClient

NewOperationStatusClient creates a new instance of OperationStatusClient.

func (*ClientFactory) NewOperationsClient

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

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 DataPoint

type DataPoint struct {
	// REQUIRED; The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on
	// the asset.
	DataSource *string

	// The path to the type definition of the capability (e.g. DTMI, OPC UA information model node id, etc.), for example dtmi:com:example:Robot:contents:_prop1;1.
	CapabilityID *string

	// Protocol-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval,
	// samplingInterval, and queueSize.
	DataPointConfiguration *string

	// The name of the data point.
	Name *string

	// An indication of how the data point should be mapped to OpenTelemetry.
	ObservabilityMode *DataPointsObservabilityMode
}

DataPoint - Defines the data point properties.

func (DataPoint) MarshalJSON

func (d DataPoint) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DataPoint.

func (*DataPoint) UnmarshalJSON

func (d *DataPoint) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DataPoint.

type DataPointsObservabilityMode

type DataPointsObservabilityMode string

DataPointsObservabilityMode - An indication of how the data point should be mapped to OpenTelemetry.

const (
	// DataPointsObservabilityModeCounter - Map as counter to OpenTelemetry.
	DataPointsObservabilityModeCounter DataPointsObservabilityMode = "counter"
	// DataPointsObservabilityModeGauge - Map as gauge to OpenTelemetry.
	DataPointsObservabilityModeGauge DataPointsObservabilityMode = "gauge"
	// DataPointsObservabilityModeHistogram - Map as histogram to OpenTelemetry.
	DataPointsObservabilityModeHistogram DataPointsObservabilityMode = "histogram"
	// DataPointsObservabilityModeLog - Map as log to OpenTelemetry.
	DataPointsObservabilityModeLog DataPointsObservabilityMode = "log"
	// DataPointsObservabilityModeNone - No mapping to OpenTelemetry.
	DataPointsObservabilityModeNone DataPointsObservabilityMode = "none"
)

func PossibleDataPointsObservabilityModeValues

func PossibleDataPointsObservabilityModeValues() []DataPointsObservabilityMode

PossibleDataPointsObservabilityModeValues returns the possible values for the DataPointsObservabilityMode const type.

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

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

MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.

func (*ErrorAdditionalInfo) UnmarshalJSON

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

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

UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.

type Event

type Event struct {
	// REQUIRED; The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the
	// asset.
	EventNotifier *string

	// The path to the type definition of the capability (e.g. DTMI, OPC UA information model node id, etc.), for example dtmi:com:example:Robot:contents:_prop1;1.
	CapabilityID *string

	// Protocol-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval,
	// and queueSize.
	EventConfiguration *string

	// The name of the event.
	Name *string

	// An indication of how the event should be mapped to OpenTelemetry.
	ObservabilityMode *EventsObservabilityMode
}

Event - Defines the event properties.

func (Event) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Event.

func (*Event) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Event.

type EventsObservabilityMode

type EventsObservabilityMode string

EventsObservabilityMode - An indication of how the event should be mapped to OpenTelemetry.

const (
	// EventsObservabilityModeLog - Map as log to OpenTelemetry.
	EventsObservabilityModeLog EventsObservabilityMode = "log"
	// EventsObservabilityModeNone - No mapping to OpenTelemetry.
	EventsObservabilityModeNone EventsObservabilityMode = "none"
)

func PossibleEventsObservabilityModeValues

func PossibleEventsObservabilityModeValues() []EventsObservabilityMode

PossibleEventsObservabilityModeValues returns the possible values for the EventsObservabilityMode const type.

type ExtendedLocation

type ExtendedLocation struct {
	// REQUIRED; The extended location name.
	Name *string

	// REQUIRED; The extended location type.
	Type *string
}

ExtendedLocation - The extended location.

func (ExtendedLocation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type ExtendedLocation.

func (*ExtendedLocation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedLocation.

type Operation

type Operation struct {
	// Localized display information for this particular operation.
	Display *OperationDisplay

	// READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
	ActionType *ActionType

	// READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane
	// operations.
	IsDataAction *bool

	// READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write",
	// "Microsoft.Compute/virtualMachines/capture/action"
	Name *string

	// READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
	// value is "user,system"
	Origin *Origin
}

Operation - Details of a REST API operation, returned from the Resource Provider Operations API

func (Operation) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views.
	Description *string

	// READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual
	// Machine", "Restart Virtual Machine".
	Operation *string

	// READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft
	// Compute".
	Provider *string

	// READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job
	// Schedule Collections".
	Resource *string
}

OperationDisplay - Localized display information for this particular operation.

func (OperationDisplay) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// READ-ONLY; URL to get the next set of operation list results (if there are any).
	NextLink *string

	// READ-ONLY; List of operations supported by the resource provider
	Value []*Operation
}

OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.

func (OperationListResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationStatusClient

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

OperationStatusClient contains the methods for the OperationStatus group. Don't use this type directly, use NewOperationStatusClient() instead.

func NewOperationStatusClient

func NewOperationStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationStatusClient, error)

NewOperationStatusClient creates a new instance of OperationStatusClient 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 (*OperationStatusClient) Get

Get - Returns the current status of an async operation. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2023-11-01-preview

  • location - The name of Azure region.
  • operationID - The ID of an ongoing async operation.
  • options - OperationStatusClientGetOptions contains the optional parameters for the OperationStatusClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/Get_OperationStatus.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	res, err := clientFactory.NewOperationStatusClient().Get(ctx, "testLocation", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 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.OperationStatusResult = armdeviceregistry.OperationStatusResult{
	// 	Name: to.Ptr("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),
	// 	EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-21T13:28:03.898Z"); return t}()),
	// 	ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.DeviceRegistry/locations/testLocation/operationStatuses/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),
	// 	PercentComplete: to.Ptr[float32](100),
	// 	StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-21T13:27:03.898Z"); return t}()),
	// 	Status: to.Ptr("Succeeded"),
	// }
}
Output:

type OperationStatusClientGetOptions

type OperationStatusClientGetOptions struct {
}

OperationStatusClientGetOptions contains the optional parameters for the OperationStatusClient.Get method.

type OperationStatusClientGetResponse

type OperationStatusClientGetResponse struct {
	// The current status of an async operation.
	OperationStatusResult
}

OperationStatusClientGetResponse contains the response from method OperationStatusClient.Get.

type OperationStatusResult

type OperationStatusResult struct {
	// REQUIRED; Operation status.
	Status *string

	// The end time of the operation.
	EndTime *time.Time

	// If present, details of the operation error.
	Error *ErrorDetail

	// Fully qualified ID for the async operation.
	ID *string

	// Name of the async operation.
	Name *string

	// The operations list.
	Operations []*OperationStatusResult

	// Percent of the operation that is complete.
	PercentComplete *float32

	// The start time of the operation.
	StartTime *time.Time
}

OperationStatusResult - The current status of an async operation.

func (OperationStatusResult) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OperationStatusResult.

func (*OperationStatusResult) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusResult.

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) NewListPager

NewListPager - List the operations for the provider

Generated from API version 2023-11-01-preview

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c77bbf822be2deaac1b690270c6cd03a52df0e37/specification/deviceregistry/resource-manager/Microsoft.DeviceRegistry/preview/2023-11-01-preview/examples/List_Operations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceregistry/armdeviceregistry"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armdeviceregistry.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 = armdeviceregistry.OperationListResult{
		// 	Value: []*armdeviceregistry.Operation{
		// 		{
		// 			Name: to.Ptr("Microsoft.DeviceRegistry/assets/write"),
		// 			Display: &armdeviceregistry.OperationDisplay{
		// 				Operation: to.Ptr("write"),
		// 				Provider: to.Ptr("Microsoft Azure Device Registry"),
		// 				Resource: to.Ptr("Asset"),
		// 			},
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type Origin

type Origin string

Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"

const (
	OriginSystem     Origin = "system"
	OriginUser       Origin = "user"
	OriginUserSystem Origin = "user,system"
)

func PossibleOriginValues

func PossibleOriginValues() []Origin

PossibleOriginValues returns the possible values for the Origin const type.

type OwnCertificate

type OwnCertificate struct {
	// Secret Reference Name (Pfx or Pem password).
	CertPasswordReference *string

	// Secret Reference name (cert and private key).
	CertSecretReference *string

	// Certificate thumbprint.
	CertThumbprint *string
}

OwnCertificate - Certificate or private key that can be used by the southbound connector connecting to the shop floor/OT device. The accepted extensions are .der for certificates and .pfx/.pem for private keys.

func (OwnCertificate) MarshalJSON

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

MarshalJSON implements the json.Marshaller interface for type OwnCertificate.

func (*OwnCertificate) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaller interface for type OwnCertificate.

type ProvisioningState

type ProvisioningState string

ProvisioningState - The provisioning status of the resource.

const (
	// ProvisioningStateAccepted - Resource has been accepted by the server.
	ProvisioningStateAccepted ProvisioningState = "Accepted"
	// ProvisioningStateCanceled - Resource creation was canceled.
	ProvisioningStateCanceled ProvisioningState = "Canceled"
	// ProvisioningStateFailed - Resource creation failed.
	ProvisioningStateFailed ProvisioningState = "Failed"
	// ProvisioningStateSucceeded - Resource has been created.
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState 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 last modification (UTC)
	LastModifiedAt *time.Time

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

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

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 TransportAuthentication

type TransportAuthentication struct {
	// REQUIRED; Defines a reference to a secret which contains all certificates and private keys that can be used by the southbound
	// connector connecting to the shop floor/OT device. The accepted extensions are .der
	// for certificates and .pfx/.pem for private keys.
	OwnCertificates []*OwnCertificate
}

TransportAuthentication - Definition of the authentication mechanism for the southbound connector.

func (TransportAuthentication) MarshalJSON

func (t TransportAuthentication) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TransportAuthentication.

func (*TransportAuthentication) UnmarshalJSON

func (t *TransportAuthentication) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TransportAuthentication.

type TransportAuthenticationUpdate

type TransportAuthenticationUpdate struct {
	// Defines a reference to a secret which contains all certificates and private keys that can be used by the southbound connector
	// connecting to the shop floor/OT device. The accepted extensions are .der
	// for certificates and .pfx/.pem for private keys.
	OwnCertificates []*OwnCertificate
}

TransportAuthenticationUpdate - Definition of the authentication mechanism for the southbound connector.

func (TransportAuthenticationUpdate) MarshalJSON

func (t TransportAuthenticationUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type TransportAuthenticationUpdate.

func (*TransportAuthenticationUpdate) UnmarshalJSON

func (t *TransportAuthenticationUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type TransportAuthenticationUpdate.

type UserAuthentication

type UserAuthentication struct {
	// REQUIRED; Defines the mode to authenticate the user of the client at the server.
	Mode *UserAuthenticationMode

	// Defines the username and password references when UsernamePassword user authentication mode is selected.
	UsernamePasswordCredentials *UsernamePasswordCredentials

	// Defines the certificate reference when Certificate user authentication mode is selected.
	X509Credentials *X509Credentials
}

UserAuthentication - Definition of the client authentication mechanism to the server.

func (UserAuthentication) MarshalJSON

func (u UserAuthentication) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserAuthentication.

func (*UserAuthentication) UnmarshalJSON

func (u *UserAuthentication) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserAuthentication.

type UserAuthenticationMode

type UserAuthenticationMode string

UserAuthenticationMode - Defines the mode to authenticate the user of the client at the server.

const (
	// UserAuthenticationModeAnonymous - The user authentication mode is anonymous.
	UserAuthenticationModeAnonymous UserAuthenticationMode = "Anonymous"
	// UserAuthenticationModeCertificate - The user authentication mode is an x509 certificate.
	UserAuthenticationModeCertificate UserAuthenticationMode = "Certificate"
	// UserAuthenticationModeUsernamePassword - The user authentication mode is a username and password.
	UserAuthenticationModeUsernamePassword UserAuthenticationMode = "UsernamePassword"
)

func PossibleUserAuthenticationModeValues

func PossibleUserAuthenticationModeValues() []UserAuthenticationMode

PossibleUserAuthenticationModeValues returns the possible values for the UserAuthenticationMode const type.

type UserAuthenticationUpdate

type UserAuthenticationUpdate struct {
	// Defines the mode to authenticate the user of the client at the server.
	Mode *UserAuthenticationMode

	// Defines the username and password references when UsernamePassword user authentication mode is selected.
	UsernamePasswordCredentials *UsernamePasswordCredentialsUpdate

	// Defines the certificate reference when Certificate user authentication mode is selected.
	X509Credentials *X509CredentialsUpdate
}

UserAuthenticationUpdate - Definition of the client authentication mechanism to the server.

func (UserAuthenticationUpdate) MarshalJSON

func (u UserAuthenticationUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserAuthenticationUpdate.

func (*UserAuthenticationUpdate) UnmarshalJSON

func (u *UserAuthenticationUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserAuthenticationUpdate.

type UsernamePasswordCredentials

type UsernamePasswordCredentials struct {
	// REQUIRED; A reference to secret containing the password.
	PasswordReference *string

	// REQUIRED; A reference to secret containing the username.
	UsernameReference *string
}

UsernamePasswordCredentials - The credentials for authentication mode UsernamePassword.

func (UsernamePasswordCredentials) MarshalJSON

func (u UsernamePasswordCredentials) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UsernamePasswordCredentials.

func (*UsernamePasswordCredentials) UnmarshalJSON

func (u *UsernamePasswordCredentials) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UsernamePasswordCredentials.

type UsernamePasswordCredentialsUpdate

type UsernamePasswordCredentialsUpdate struct {
	// A reference to secret containing the password.
	PasswordReference *string

	// A reference to secret containing the username.
	UsernameReference *string
}

UsernamePasswordCredentialsUpdate - The credentials for authentication mode UsernamePassword.

func (UsernamePasswordCredentialsUpdate) MarshalJSON

func (u UsernamePasswordCredentialsUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UsernamePasswordCredentialsUpdate.

func (*UsernamePasswordCredentialsUpdate) UnmarshalJSON

func (u *UsernamePasswordCredentialsUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UsernamePasswordCredentialsUpdate.

type X509Credentials

type X509Credentials struct {
	// REQUIRED; A reference to secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx).
	CertificateReference *string
}

X509Credentials - The x509 certificate for authentication mode Certificate.

func (X509Credentials) MarshalJSON

func (x X509Credentials) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type X509Credentials.

func (*X509Credentials) UnmarshalJSON

func (x *X509Credentials) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type X509Credentials.

type X509CredentialsUpdate

type X509CredentialsUpdate struct {
	// A reference to secret containing the certificate and private key (e.g. stored as .der/.pem or .der/.pfx).
	CertificateReference *string
}

X509CredentialsUpdate - The x509 certificate for authentication mode Certificate.

func (X509CredentialsUpdate) MarshalJSON

func (x X509CredentialsUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type X509CredentialsUpdate.

func (*X509CredentialsUpdate) UnmarshalJSON

func (x *X509CredentialsUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type X509CredentialsUpdate.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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