assets

package
v0.20241126.2320 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/deviceregistry/2024-09-01-preview/assets Documentation

The assets SDK allows for interaction with Azure Resource Manager deviceregistry (API Version 2024-09-01-preview).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/deviceregistry/2024-09-01-preview/assets"

Client Initialization

client := assets.NewAssetsClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: AssetsClient.CreateOrReplace

ctx := context.TODO()
id := assets.NewAssetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "assetName")

payload := assets.Asset{
	// ...
}


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

Example Usage: AssetsClient.Delete

ctx := context.TODO()
id := assets.NewAssetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "assetName")

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

Example Usage: AssetsClient.Get

ctx := context.TODO()
id := assets.NewAssetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "assetName")

read, err := client.Get(ctx, id)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: AssetsClient.ListByResourceGroup

ctx := context.TODO()
id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group")

// alternatively `client.ListByResourceGroup(ctx, id)` can be used to do batched pagination
items, err := client.ListByResourceGroupComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AssetsClient.ListBySubscription

ctx := context.TODO()
id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012")

// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination
items, err := client.ListBySubscriptionComplete(ctx, id)
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: AssetsClient.Update

ctx := context.TODO()
id := assets.NewAssetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "assetName")

payload := assets.AssetUpdate{
	// ...
}


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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForDataPointObservabilityMode

func PossibleValuesForDataPointObservabilityMode() []string

func PossibleValuesForEventObservabilityMode

func PossibleValuesForEventObservabilityMode() []string

func PossibleValuesForProvisioningState

func PossibleValuesForProvisioningState() []string

func PossibleValuesForTopicRetainType

func PossibleValuesForTopicRetainType() []string

func ValidateAssetID

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

ValidateAssetID checks that 'input' can be parsed as a Asset ID

Types

type Asset

type Asset struct {
	ExtendedLocation ExtendedLocation       `json:"extendedLocation"`
	Id               *string                `json:"id,omitempty"`
	Location         string                 `json:"location"`
	Name             *string                `json:"name,omitempty"`
	Properties       *AssetProperties       `json:"properties,omitempty"`
	SystemData       *systemdata.SystemData `json:"systemData,omitempty"`
	Tags             *map[string]string     `json:"tags,omitempty"`
	Type             *string                `json:"type,omitempty"`
}

type AssetId

type AssetId struct {
	SubscriptionId    string
	ResourceGroupName string
	AssetName         string
}

AssetId is a struct representing the Resource ID for a Asset

func NewAssetID

func NewAssetID(subscriptionId string, resourceGroupName string, assetName string) AssetId

NewAssetID returns a new AssetId struct

func ParseAssetID

func ParseAssetID(input string) (*AssetId, error)

ParseAssetID parses 'input' into a AssetId

func ParseAssetIDInsensitively

func ParseAssetIDInsensitively(input string) (*AssetId, error)

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

func (*AssetId) FromParseResult

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

func (AssetId) ID

func (id AssetId) ID() string

ID returns the formatted Asset ID

func (AssetId) Segments

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

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

func (AssetId) String

func (id AssetId) String() string

String returns a human-readable description of this Asset ID

type AssetOperationPredicate

type AssetOperationPredicate struct {
	Id       *string
	Location *string
	Name     *string
	Type     *string
}

func (AssetOperationPredicate) Matches

func (p AssetOperationPredicate) Matches(input Asset) bool

type AssetProperties

type AssetProperties struct {
	AssetEndpointProfileRef      string                  `json:"assetEndpointProfileRef"`
	Attributes                   *map[string]interface{} `json:"attributes,omitempty"`
	Datasets                     *[]Dataset              `json:"datasets,omitempty"`
	DefaultDatasetsConfiguration *string                 `json:"defaultDatasetsConfiguration,omitempty"`
	DefaultEventsConfiguration   *string                 `json:"defaultEventsConfiguration,omitempty"`
	DefaultTopic                 *Topic                  `json:"defaultTopic,omitempty"`
	Description                  *string                 `json:"description,omitempty"`
	DiscoveredAssetRefs          *[]string               `json:"discoveredAssetRefs,omitempty"`
	DisplayName                  *string                 `json:"displayName,omitempty"`
	DocumentationUri             *string                 `json:"documentationUri,omitempty"`
	Enabled                      *bool                   `json:"enabled,omitempty"`
	Events                       *[]Event                `json:"events,omitempty"`
	ExternalAssetId              *string                 `json:"externalAssetId,omitempty"`
	HardwareRevision             *string                 `json:"hardwareRevision,omitempty"`
	Manufacturer                 *string                 `json:"manufacturer,omitempty"`
	ManufacturerUri              *string                 `json:"manufacturerUri,omitempty"`
	Model                        *string                 `json:"model,omitempty"`
	ProductCode                  *string                 `json:"productCode,omitempty"`
	ProvisioningState            *ProvisioningState      `json:"provisioningState,omitempty"`
	SerialNumber                 *string                 `json:"serialNumber,omitempty"`
	SoftwareRevision             *string                 `json:"softwareRevision,omitempty"`
	Status                       *AssetStatus            `json:"status,omitempty"`
	Uuid                         *string                 `json:"uuid,omitempty"`
	Version                      *int64                  `json:"version,omitempty"`
}

type AssetStatus

type AssetStatus struct {
	Datasets *[]AssetStatusDataset `json:"datasets,omitempty"`
	Errors   *[]AssetStatusError   `json:"errors,omitempty"`
	Events   *[]AssetStatusEvent   `json:"events,omitempty"`
	Version  *int64                `json:"version,omitempty"`
}

type AssetStatusDataset

type AssetStatusDataset struct {
	MessageSchemaReference *MessageSchemaReference `json:"messageSchemaReference,omitempty"`
	Name                   string                  `json:"name"`
}

type AssetStatusError

type AssetStatusError struct {
	Code    *int64  `json:"code,omitempty"`
	Message *string `json:"message,omitempty"`
}

type AssetStatusEvent

type AssetStatusEvent struct {
	MessageSchemaReference *MessageSchemaReference `json:"messageSchemaReference,omitempty"`
	Name                   string                  `json:"name"`
}

type AssetUpdate

type AssetUpdate struct {
	Properties *AssetUpdateProperties `json:"properties,omitempty"`
	Tags       *map[string]string     `json:"tags,omitempty"`
}

type AssetUpdateProperties

type AssetUpdateProperties struct {
	Attributes                   *map[string]interface{} `json:"attributes,omitempty"`
	Datasets                     *[]Dataset              `json:"datasets,omitempty"`
	DefaultDatasetsConfiguration *string                 `json:"defaultDatasetsConfiguration,omitempty"`
	DefaultEventsConfiguration   *string                 `json:"defaultEventsConfiguration,omitempty"`
	DefaultTopic                 *TopicUpdate            `json:"defaultTopic,omitempty"`
	Description                  *string                 `json:"description,omitempty"`
	DisplayName                  *string                 `json:"displayName,omitempty"`
	DocumentationUri             *string                 `json:"documentationUri,omitempty"`
	Enabled                      *bool                   `json:"enabled,omitempty"`
	Events                       *[]Event                `json:"events,omitempty"`
	HardwareRevision             *string                 `json:"hardwareRevision,omitempty"`
	Manufacturer                 *string                 `json:"manufacturer,omitempty"`
	ManufacturerUri              *string                 `json:"manufacturerUri,omitempty"`
	Model                        *string                 `json:"model,omitempty"`
	ProductCode                  *string                 `json:"productCode,omitempty"`
	SerialNumber                 *string                 `json:"serialNumber,omitempty"`
	SoftwareRevision             *string                 `json:"softwareRevision,omitempty"`
}

type AssetsClient

type AssetsClient struct {
	Client *resourcemanager.Client
}

func NewAssetsClientWithBaseURI

func NewAssetsClientWithBaseURI(sdkApi sdkEnv.Api) (*AssetsClient, error)

func (AssetsClient) CreateOrReplace

func (c AssetsClient) CreateOrReplace(ctx context.Context, id AssetId, input Asset) (result CreateOrReplaceOperationResponse, err error)

CreateOrReplace ...

func (AssetsClient) CreateOrReplaceThenPoll

func (c AssetsClient) CreateOrReplaceThenPoll(ctx context.Context, id AssetId, input Asset) error

CreateOrReplaceThenPoll performs CreateOrReplace then polls until it's completed

func (AssetsClient) Delete

func (c AssetsClient) Delete(ctx context.Context, id AssetId) (result DeleteOperationResponse, err error)

Delete ...

func (AssetsClient) DeleteThenPoll

func (c AssetsClient) DeleteThenPoll(ctx context.Context, id AssetId) error

DeleteThenPoll performs Delete then polls until it's completed

func (AssetsClient) Get

func (c AssetsClient) Get(ctx context.Context, id AssetId) (result GetOperationResponse, err error)

Get ...

func (AssetsClient) ListByResourceGroup

ListByResourceGroup ...

func (AssetsClient) ListByResourceGroupComplete

ListByResourceGroupComplete retrieves all the results into a single object

func (AssetsClient) ListByResourceGroupCompleteMatchingPredicate

func (c AssetsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate AssetOperationPredicate) (result ListByResourceGroupCompleteResult, err error)

ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (AssetsClient) ListBySubscription

ListBySubscription ...

func (AssetsClient) ListBySubscriptionComplete

ListBySubscriptionComplete retrieves all the results into a single object

func (AssetsClient) ListBySubscriptionCompleteMatchingPredicate

func (c AssetsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate AssetOperationPredicate) (result ListBySubscriptionCompleteResult, err error)

ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (AssetsClient) Update

func (c AssetsClient) Update(ctx context.Context, id AssetId, input AssetUpdate) (result UpdateOperationResponse, err error)

Update ...

func (AssetsClient) UpdateThenPoll

func (c AssetsClient) UpdateThenPoll(ctx context.Context, id AssetId, input AssetUpdate) error

UpdateThenPoll performs Update then polls until it's completed

type CreateOrReplaceOperationResponse

type CreateOrReplaceOperationResponse struct {
	Poller       pollers.Poller
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *Asset
}

type DataPoint

type DataPoint struct {
	DataPointConfiguration *string                     `json:"dataPointConfiguration,omitempty"`
	DataSource             string                      `json:"dataSource"`
	Name                   string                      `json:"name"`
	ObservabilityMode      *DataPointObservabilityMode `json:"observabilityMode,omitempty"`
}

type DataPointObservabilityMode

type DataPointObservabilityMode string
const (
	DataPointObservabilityModeCounter   DataPointObservabilityMode = "Counter"
	DataPointObservabilityModeGauge     DataPointObservabilityMode = "Gauge"
	DataPointObservabilityModeHistogram DataPointObservabilityMode = "Histogram"
	DataPointObservabilityModeLog       DataPointObservabilityMode = "Log"
	DataPointObservabilityModeNone      DataPointObservabilityMode = "None"
)

func (*DataPointObservabilityMode) UnmarshalJSON

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

type Dataset

type Dataset struct {
	DataPoints           *[]DataPoint `json:"dataPoints,omitempty"`
	DatasetConfiguration *string      `json:"datasetConfiguration,omitempty"`
	Name                 string       `json:"name"`
	Topic                *Topic       `json:"topic,omitempty"`
}

type DeleteOperationResponse

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

type Event

type Event struct {
	EventConfiguration *string                 `json:"eventConfiguration,omitempty"`
	EventNotifier      string                  `json:"eventNotifier"`
	Name               string                  `json:"name"`
	ObservabilityMode  *EventObservabilityMode `json:"observabilityMode,omitempty"`
	Topic              *Topic                  `json:"topic,omitempty"`
}

type EventObservabilityMode

type EventObservabilityMode string
const (
	EventObservabilityModeLog  EventObservabilityMode = "Log"
	EventObservabilityModeNone EventObservabilityMode = "None"
)

func (*EventObservabilityMode) UnmarshalJSON

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

type ExtendedLocation

type ExtendedLocation struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type GetOperationResponse

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

type ListByResourceGroupCompleteResult

type ListByResourceGroupCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Asset
}

type ListByResourceGroupCustomPager

type ListByResourceGroupCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListByResourceGroupCustomPager) NextPageLink() *odata.Link

type ListByResourceGroupOperationResponse

type ListByResourceGroupOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Asset
}

type ListBySubscriptionCompleteResult

type ListBySubscriptionCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []Asset
}

type ListBySubscriptionCustomPager

type ListBySubscriptionCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListBySubscriptionCustomPager) NextPageLink() *odata.Link

type ListBySubscriptionOperationResponse

type ListBySubscriptionOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]Asset
}

type MessageSchemaReference

type MessageSchemaReference struct {
	SchemaName              string `json:"schemaName"`
	SchemaRegistryNamespace string `json:"schemaRegistryNamespace"`
	SchemaVersion           string `json:"schemaVersion"`
}

type ProvisioningState

type ProvisioningState string
const (
	ProvisioningStateAccepted  ProvisioningState = "Accepted"
	ProvisioningStateCanceled  ProvisioningState = "Canceled"
	ProvisioningStateDeleting  ProvisioningState = "Deleting"
	ProvisioningStateFailed    ProvisioningState = "Failed"
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)

func (*ProvisioningState) UnmarshalJSON

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

type Topic

type Topic struct {
	Path   string           `json:"path"`
	Retain *TopicRetainType `json:"retain,omitempty"`
}

type TopicRetainType

type TopicRetainType string
const (
	TopicRetainTypeKeep  TopicRetainType = "Keep"
	TopicRetainTypeNever TopicRetainType = "Never"
)

func (*TopicRetainType) UnmarshalJSON

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

type TopicUpdate

type TopicUpdate struct {
	Path   *string          `json:"path,omitempty"`
	Retain *TopicRetainType `json:"retain,omitempty"`
}

type UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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