Documentation ¶
Index ¶
- type AuthorizedState
- type ClientFactory
- func (c *ClientFactory) NewDefenderSettingsClient() *DefenderSettingsClient
- func (c *ClientFactory) NewDeviceGroupsClient() *DeviceGroupsClient
- func (c *ClientFactory) NewDevicesClient() *DevicesClient
- func (c *ClientFactory) NewLocationsClient() *LocationsClient
- func (c *ClientFactory) NewOnPremiseSensorsClient() *OnPremiseSensorsClient
- func (c *ClientFactory) NewOperationsClient() *OperationsClient
- func (c *ClientFactory) NewSensorsClient() *SensorsClient
- func (c *ClientFactory) NewSitesClient() *SitesClient
- type CreatedByType
- type Criticality
- type DefenderSettingsClient
- func (client *DefenderSettingsClient) CreateOrUpdate(ctx context.Context, defenderSettingsModel DefenderSettingsModel, ...) (DefenderSettingsClientCreateOrUpdateResponse, error)
- func (client *DefenderSettingsClient) Delete(ctx context.Context, options *DefenderSettingsClientDeleteOptions) (DefenderSettingsClientDeleteResponse, error)
- func (client *DefenderSettingsClient) DownloadManagerActivation(ctx context.Context, ...) (DefenderSettingsClientDownloadManagerActivationResponse, error)
- func (client *DefenderSettingsClient) Get(ctx context.Context, options *DefenderSettingsClientGetOptions) (DefenderSettingsClientGetResponse, error)
- func (client *DefenderSettingsClient) List(ctx context.Context, options *DefenderSettingsClientListOptions) (DefenderSettingsClientListResponse, error)
- func (client *DefenderSettingsClient) PackageDownloads(ctx context.Context, options *DefenderSettingsClientPackageDownloadsOptions) (DefenderSettingsClientPackageDownloadsResponse, error)
- type DefenderSettingsClientCreateOrUpdateOptions
- type DefenderSettingsClientCreateOrUpdateResponse
- type DefenderSettingsClientDeleteOptions
- type DefenderSettingsClientDeleteResponse
- type DefenderSettingsClientDownloadManagerActivationOptions
- type DefenderSettingsClientDownloadManagerActivationResponse
- type DefenderSettingsClientGetOptions
- type DefenderSettingsClientGetResponse
- type DefenderSettingsClientListOptions
- type DefenderSettingsClientListResponse
- type DefenderSettingsClientPackageDownloadsOptions
- type DefenderSettingsClientPackageDownloadsResponse
- type DefenderSettingsList
- type DefenderSettingsModel
- type DefenderSettingsProperties
- type DefenderSettingsPropertiesMdeIntegration
- type DeviceDataSource
- type DeviceGroupList
- type DeviceGroupModel
- type DeviceGroupsClient
- func (client *DeviceGroupsClient) CreateOrUpdate(ctx context.Context, iotDefenderLocation string, deviceGroupName string, ...) (DeviceGroupsClientCreateOrUpdateResponse, error)
- func (client *DeviceGroupsClient) Delete(ctx context.Context, iotDefenderLocation string, deviceGroupName string, ...) (DeviceGroupsClientDeleteResponse, error)
- func (client *DeviceGroupsClient) Get(ctx context.Context, iotDefenderLocation string, deviceGroupName string, ...) (DeviceGroupsClientGetResponse, error)
- func (client *DeviceGroupsClient) NewListPager(iotDefenderLocation string, options *DeviceGroupsClientListOptions) *runtime.Pager[DeviceGroupsClientListResponse]
- type DeviceGroupsClientCreateOrUpdateOptions
- type DeviceGroupsClientCreateOrUpdateResponse
- type DeviceGroupsClientDeleteOptions
- type DeviceGroupsClientDeleteResponse
- type DeviceGroupsClientGetOptions
- type DeviceGroupsClientGetResponse
- type DeviceGroupsClientListOptions
- type DeviceGroupsClientListResponse
- type DeviceList
- type DeviceModel
- type DeviceProperties
- type DeviceStatus
- type DevicesClient
- type DevicesClientGetOptions
- type DevicesClientGetResponse
- type DevicesClientListOptions
- type DevicesClientListResponse
- type DimensionProperties
- type ErrorAdditionalInfo
- type ErrorDetail
- type ErrorModel
- type ErrorResponse
- type ErrorResponseModel
- type ErrorResponseModelError
- type Firmware
- type Hardware
- type LocationList
- type LocationModel
- type LocationsClient
- type LocationsClientGetOptions
- type LocationsClientGetResponse
- type LocationsClientListOptions
- type LocationsClientListResponse
- type MacCertainty
- type MdeIntegration
- type MergedDevice
- type Nic
- type OnPremiseSensor
- type OnPremiseSensorsClient
- func (client *OnPremiseSensorsClient) CreateOrUpdate(ctx context.Context, onPremiseSensorName string, ...) (OnPremiseSensorsClientCreateOrUpdateResponse, error)
- func (client *OnPremiseSensorsClient) Delete(ctx context.Context, onPremiseSensorName string, ...) (OnPremiseSensorsClientDeleteResponse, error)
- func (client *OnPremiseSensorsClient) DownloadActivation(ctx context.Context, onPremiseSensorName string, ...) (OnPremiseSensorsClientDownloadActivationResponse, error)
- func (client *OnPremiseSensorsClient) DownloadResetPassword(ctx context.Context, onPremiseSensorName string, body ResetPasswordInput, ...) (OnPremiseSensorsClientDownloadResetPasswordResponse, error)
- func (client *OnPremiseSensorsClient) Get(ctx context.Context, onPremiseSensorName string, ...) (OnPremiseSensorsClientGetResponse, error)
- func (client *OnPremiseSensorsClient) List(ctx context.Context, options *OnPremiseSensorsClientListOptions) (OnPremiseSensorsClientListResponse, error)
- type OnPremiseSensorsClientCreateOrUpdateOptions
- type OnPremiseSensorsClientCreateOrUpdateResponse
- type OnPremiseSensorsClientDeleteOptions
- type OnPremiseSensorsClientDeleteResponse
- type OnPremiseSensorsClientDownloadActivationOptions
- type OnPremiseSensorsClientDownloadActivationResponse
- type OnPremiseSensorsClientDownloadResetPasswordOptions
- type OnPremiseSensorsClientDownloadResetPasswordResponse
- type OnPremiseSensorsClientGetOptions
- type OnPremiseSensorsClientGetResponse
- type OnPremiseSensorsClientListOptions
- type OnPremiseSensorsClientListResponse
- type OnPremiseSensorsList
- type OnboardingKind
- type OnboardingStatus
- type OperatingSystem
- type Operation
- type OperationDisplay
- type OperationList
- type OperationMetaLogSpecification
- type OperationMetaMetricSpecification
- type OperationMetaServiceSpecification
- type OperationProperties
- type OperationsClient
- type OperationsClientListOptions
- type OperationsClientListResponse
- type Package
- type PackageDownloadInfo
- type PackageDownloads
- type PackageDownloadsCentralManager
- type PackageDownloadsCentralManagerFull
- type PackageDownloadsCentralManagerFullOvf
- type PackageDownloadsSensor
- type PackageDownloadsSensorFull
- type PackageDownloadsSensorFullOvf
- type ProgrammingState
- type ProxyResource
- type PurdueLevel
- type ResetPasswordInput
- type Resource
- type Sensor
- type SensorModel
- type SensorProperties
- type SensorStatus
- type SensorType
- type SensorsClient
- func (client *SensorsClient) CreateOrUpdate(ctx context.Context, scope string, sensorName string, sensorModel SensorModel, ...) (SensorsClientCreateOrUpdateResponse, error)
- func (client *SensorsClient) Delete(ctx context.Context, scope string, sensorName string, ...) (SensorsClientDeleteResponse, error)
- func (client *SensorsClient) DownloadActivation(ctx context.Context, scope string, sensorName string, ...) (SensorsClientDownloadActivationResponse, error)
- func (client *SensorsClient) DownloadResetPassword(ctx context.Context, scope string, sensorName string, body ResetPasswordInput, ...) (SensorsClientDownloadResetPasswordResponse, error)
- func (client *SensorsClient) Get(ctx context.Context, scope string, sensorName string, ...) (SensorsClientGetResponse, error)
- func (client *SensorsClient) List(ctx context.Context, scope string, options *SensorsClientListOptions) (SensorsClientListResponse, error)
- func (client *SensorsClient) TriggerTiPackageUpdate(ctx context.Context, scope string, sensorName string, ...) (SensorsClientTriggerTiPackageUpdateResponse, error)
- type SensorsClientCreateOrUpdateOptions
- type SensorsClientCreateOrUpdateResponse
- type SensorsClientDeleteOptions
- type SensorsClientDeleteResponse
- type SensorsClientDownloadActivationOptions
- type SensorsClientDownloadActivationResponse
- type SensorsClientDownloadResetPasswordOptions
- type SensorsClientDownloadResetPasswordResponse
- type SensorsClientGetOptions
- type SensorsClientGetResponse
- type SensorsClientListOptions
- type SensorsClientListResponse
- type SensorsClientTriggerTiPackageUpdateOptions
- type SensorsClientTriggerTiPackageUpdateResponse
- type SensorsList
- type SiteModel
- type SiteProperties
- type SitesClient
- func (client *SitesClient) CreateOrUpdate(ctx context.Context, scope string, siteModel SiteModel, ...) (SitesClientCreateOrUpdateResponse, error)
- func (client *SitesClient) Delete(ctx context.Context, scope string, options *SitesClientDeleteOptions) (SitesClientDeleteResponse, error)
- func (client *SitesClient) Get(ctx context.Context, scope string, options *SitesClientGetOptions) (SitesClientGetResponse, error)
- func (client *SitesClient) List(ctx context.Context, scope string, options *SitesClientListOptions) (SitesClientListResponse, error)
- type SitesClientCreateOrUpdateOptions
- type SitesClientCreateOrUpdateResponse
- type SitesClientDeleteOptions
- type SitesClientDeleteResponse
- type SitesClientGetOptions
- type SitesClientGetResponse
- type SitesClientListOptions
- type SitesClientListResponse
- type SitesList
- type Slot
- type SlotType
- type SystemData
- type TiStatus
- type UpgradePackageDownloadInfo
- type VersionKind
Examples ¶
- DefenderSettingsClient.CreateOrUpdate
- DefenderSettingsClient.Delete
- DefenderSettingsClient.DownloadManagerActivation
- DefenderSettingsClient.Get
- DefenderSettingsClient.List
- DefenderSettingsClient.PackageDownloads
- DeviceGroupsClient.CreateOrUpdate
- DeviceGroupsClient.Delete
- DeviceGroupsClient.Get
- DeviceGroupsClient.NewListPager
- DevicesClient.Get
- DevicesClient.NewListPager
- LocationsClient.Get
- LocationsClient.NewListPager
- OnPremiseSensorsClient.CreateOrUpdate
- OnPremiseSensorsClient.Delete
- OnPremiseSensorsClient.DownloadActivation
- OnPremiseSensorsClient.DownloadResetPassword
- OnPremiseSensorsClient.Get
- OnPremiseSensorsClient.List
- OperationsClient.NewListPager
- SensorsClient.CreateOrUpdate
- SensorsClient.Delete
- SensorsClient.DownloadActivation
- SensorsClient.DownloadResetPassword
- SensorsClient.Get
- SensorsClient.List
- SensorsClient.TriggerTiPackageUpdate
- SitesClient.CreateOrUpdate
- SitesClient.Delete
- SitesClient.Get
- SitesClient.List
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizedState ¶
type AuthorizedState string
AuthorizedState - Authorized state of the device.
const ( AuthorizedStateAuthorized AuthorizedState = "Authorized" )
func PossibleAuthorizedStateValues ¶
func PossibleAuthorizedStateValues() []AuthorizedState
PossibleAuthorizedStateValues returns the possible values for the AuthorizedState const type.
type ClientFactory ¶ added in v0.6.0
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.
func NewClientFactory ¶ added in v0.6.0
func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)
NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.
- subscriptionID - The ID of the target subscription.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*ClientFactory) NewDefenderSettingsClient ¶ added in v0.6.0
func (c *ClientFactory) NewDefenderSettingsClient() *DefenderSettingsClient
NewDefenderSettingsClient creates a new instance of DefenderSettingsClient.
func (*ClientFactory) NewDeviceGroupsClient ¶ added in v0.6.0
func (c *ClientFactory) NewDeviceGroupsClient() *DeviceGroupsClient
NewDeviceGroupsClient creates a new instance of DeviceGroupsClient.
func (*ClientFactory) NewDevicesClient ¶ added in v0.6.0
func (c *ClientFactory) NewDevicesClient() *DevicesClient
NewDevicesClient creates a new instance of DevicesClient.
func (*ClientFactory) NewLocationsClient ¶ added in v0.6.0
func (c *ClientFactory) NewLocationsClient() *LocationsClient
NewLocationsClient creates a new instance of LocationsClient.
func (*ClientFactory) NewOnPremiseSensorsClient ¶ added in v0.6.0
func (c *ClientFactory) NewOnPremiseSensorsClient() *OnPremiseSensorsClient
NewOnPremiseSensorsClient creates a new instance of OnPremiseSensorsClient.
func (*ClientFactory) NewOperationsClient ¶ added in v0.6.0
func (c *ClientFactory) NewOperationsClient() *OperationsClient
NewOperationsClient creates a new instance of OperationsClient.
func (*ClientFactory) NewSensorsClient ¶ added in v0.6.0
func (c *ClientFactory) NewSensorsClient() *SensorsClient
NewSensorsClient creates a new instance of SensorsClient.
func (*ClientFactory) NewSitesClient ¶ added in v0.6.0
func (c *ClientFactory) NewSitesClient() *SitesClient
NewSitesClient creates a new instance of SitesClient.
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 Criticality ¶
type Criticality string
Criticality - Device criticality.
const ( CriticalityHigh Criticality = "High" CriticalityLow Criticality = "Low" CriticalityNormal Criticality = "Normal" )
func PossibleCriticalityValues ¶
func PossibleCriticalityValues() []Criticality
PossibleCriticalityValues returns the possible values for the Criticality const type.
type DefenderSettingsClient ¶
type DefenderSettingsClient struct {
// contains filtered or unexported fields
}
DefenderSettingsClient contains the methods for the DefenderSettings group. Don't use this type directly, use NewDefenderSettingsClient() instead.
func NewDefenderSettingsClient ¶
func NewDefenderSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DefenderSettingsClient, error)
NewDefenderSettingsClient creates a new instance of DefenderSettingsClient 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 (*DefenderSettingsClient) CreateOrUpdate ¶
func (client *DefenderSettingsClient) CreateOrUpdate(ctx context.Context, defenderSettingsModel DefenderSettingsModel, options *DefenderSettingsClientCreateOrUpdateOptions) (DefenderSettingsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update IoT Defender settings If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- defenderSettingsModel - The IoT defender settings model
- options - DefenderSettingsClientCreateOrUpdateOptions contains the optional parameters for the DefenderSettingsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DefenderSettings/Put.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/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDefenderSettingsClient().CreateOrUpdate(ctx, armiotsecurity.DefenderSettingsModel{ Properties: &armiotsecurity.DefenderSettingsProperties{ DeviceQuota: to.Ptr[int32](2000), MdeIntegration: &armiotsecurity.DefenderSettingsPropertiesMdeIntegration{ Status: to.Ptr(armiotsecurity.MdeIntegrationEnabled), }, OnboardingKind: to.Ptr(armiotsecurity.OnboardingKindDefault), SentinelWorkspaceResourceIDs: []*string{ to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1")}, }, }, 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.DefenderSettingsModel = armiotsecurity.DefenderSettingsModel{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.IoTSecurity/defenderSettings"), // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.IoTSecurity/defenderSettings/default"), // Properties: &armiotsecurity.DefenderSettingsProperties{ // DeviceQuota: to.Ptr[int32](2000), // MdeIntegration: &armiotsecurity.DefenderSettingsPropertiesMdeIntegration{ // Status: to.Ptr(armiotsecurity.MdeIntegrationEnabled), // }, // OnboardingKind: to.Ptr(armiotsecurity.OnboardingKindDefault), // SentinelWorkspaceResourceIDs: []*string{ // to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1")}, // }, // } }
Output:
func (*DefenderSettingsClient) Delete ¶
func (client *DefenderSettingsClient) Delete(ctx context.Context, options *DefenderSettingsClientDeleteOptions) (DefenderSettingsClientDeleteResponse, error)
Delete - Delete IoT Defender settings If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- options - DefenderSettingsClientDeleteOptions contains the optional parameters for the DefenderSettingsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DefenderSettings/Delete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewDefenderSettingsClient().Delete(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*DefenderSettingsClient) DownloadManagerActivation ¶
func (client *DefenderSettingsClient) DownloadManagerActivation(ctx context.Context, options *DefenderSettingsClientDownloadManagerActivationOptions) (DefenderSettingsClientDownloadManagerActivationResponse, error)
DownloadManagerActivation - Download manager activation data defined for this subscription If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- options - DefenderSettingsClientDownloadManagerActivationOptions contains the optional parameters for the DefenderSettingsClient.DownloadManagerActivation method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DefenderSettings/DownloadManagerActivation.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewDefenderSettingsClient().DownloadManagerActivation(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*DefenderSettingsClient) Get ¶
func (client *DefenderSettingsClient) Get(ctx context.Context, options *DefenderSettingsClientGetOptions) (DefenderSettingsClientGetResponse, error)
Get - Get IoT Defender Settings If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- options - DefenderSettingsClientGetOptions contains the optional parameters for the DefenderSettingsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DefenderSettings/Get.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDefenderSettingsClient().Get(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DefenderSettingsModel = armiotsecurity.DefenderSettingsModel{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.IoTSecurity/defenderSettings"), // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.IoTSecurity/defenderSettings/default"), // Properties: &armiotsecurity.DefenderSettingsProperties{ // DeviceQuota: to.Ptr[int32](2000), // EvaluationEndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-06-29T00:00:00.000Z"); return t}()), // MdeIntegration: &armiotsecurity.DefenderSettingsPropertiesMdeIntegration{ // Status: to.Ptr(armiotsecurity.MdeIntegrationEnabled), // }, // OnboardingKind: to.Ptr(armiotsecurity.OnboardingKindEvaluation), // SentinelWorkspaceResourceIDs: []*string{ // to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1")}, // }, // } }
Output:
func (*DefenderSettingsClient) List ¶
func (client *DefenderSettingsClient) List(ctx context.Context, options *DefenderSettingsClientListOptions) (DefenderSettingsClientListResponse, error)
List - List IoT Defender Settings If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- options - DefenderSettingsClientListOptions contains the optional parameters for the DefenderSettingsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DefenderSettings/List.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDefenderSettingsClient().List(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.DefenderSettingsList = armiotsecurity.DefenderSettingsList{ // Value: []*armiotsecurity.DefenderSettingsModel{ // { // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.IoTSecurity/defenderSettings"), // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.IoTSecurity/defenderSettings/default"), // Properties: &armiotsecurity.DefenderSettingsProperties{ // DeviceQuota: to.Ptr[int32](2000), // MdeIntegration: &armiotsecurity.DefenderSettingsPropertiesMdeIntegration{ // Status: to.Ptr(armiotsecurity.MdeIntegrationEnabled), // }, // OnboardingKind: to.Ptr(armiotsecurity.OnboardingKindDefault), // SentinelWorkspaceResourceIDs: []*string{ // to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1")}, // }, // }}, // } }
Output:
func (*DefenderSettingsClient) PackageDownloads ¶
func (client *DefenderSettingsClient) PackageDownloads(ctx context.Context, options *DefenderSettingsClientPackageDownloadsOptions) (DefenderSettingsClientPackageDownloadsResponse, error)
PackageDownloads - Information about downloadable packages If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- options - DefenderSettingsClientPackageDownloadsOptions contains the optional parameters for the DefenderSettingsClient.PackageDownloads method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DefenderSettings/PackageDownloads.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDefenderSettingsClient().PackageDownloads(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.PackageDownloads = armiotsecurity.PackageDownloads{ // AuthorizedDevicesImportTemplate: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2020.02.10"), // }}, // CentralManager: &armiotsecurity.PackageDownloadsCentralManager{ // Full: &armiotsecurity.PackageDownloadsCentralManagerFull{ // Iso: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("3.1"), // VersionKind: to.Ptr(armiotsecurity.VersionKindLatest), // }, // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2.8.11"), // VersionKind: to.Ptr(armiotsecurity.VersionKindPrevious), // }}, // Ovf: &armiotsecurity.PackageDownloadsCentralManagerFullOvf{ // Enterprise: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("3.1"), // VersionKind: to.Ptr(armiotsecurity.VersionKindLatest), // }}, // EnterpriseHighAvailability: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("3.1"), // VersionKind: to.Ptr(armiotsecurity.VersionKindLatest), // }}, // Medium: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("3.1"), // VersionKind: to.Ptr(armiotsecurity.VersionKindLatest), // }}, // MediumHighAvailability: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("3.1"), // VersionKind: to.Ptr(armiotsecurity.VersionKindLatest), // }}, // }, // }, // Upgrade: []*armiotsecurity.UpgradePackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2.8.2"), // VersionKind: to.Ptr(armiotsecurity.VersionKindLatest), // FromVersion: to.Ptr("2.8.0"), // }, // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2.8.10"), // VersionKind: to.Ptr(armiotsecurity.VersionKindPrevious), // FromVersion: to.Ptr("2.8.0"), // }}, // }, // DeviceInformationUpdateImportTemplate: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2020.02.10"), // }}, // Sensor: &armiotsecurity.PackageDownloadsSensor{ // Full: &armiotsecurity.PackageDownloadsSensorFull{ // Iso: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("3.1"), // VersionKind: to.Ptr(armiotsecurity.VersionKindLatest), // }, // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2.8.11"), // VersionKind: to.Ptr(armiotsecurity.VersionKindPrevious), // }}, // Ovf: &armiotsecurity.PackageDownloadsSensorFullOvf{ // Enterprise: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("3.1"), // VersionKind: to.Ptr(armiotsecurity.VersionKindLatest), // }, // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2.8.11"), // VersionKind: to.Ptr(armiotsecurity.VersionKindPrevious), // }}, // Line: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("3.1"), // VersionKind: to.Ptr(armiotsecurity.VersionKindLatest), // }, // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2.8.11"), // VersionKind: to.Ptr(armiotsecurity.VersionKindPrevious), // }}, // Medium: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("3.1"), // VersionKind: to.Ptr(armiotsecurity.VersionKindLatest), // }, // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2.8.11"), // VersionKind: to.Ptr(armiotsecurity.VersionKindPrevious), // }}, // }, // }, // Upgrade: []*armiotsecurity.UpgradePackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2.8.2"), // VersionKind: to.Ptr(armiotsecurity.VersionKindLatest), // FromVersion: to.Ptr("2.8.0"), // }, // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2.8.10"), // VersionKind: to.Ptr(armiotsecurity.VersionKindPrevious), // FromVersion: to.Ptr("2.8.0"), // }}, // }, // Snmp: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2020.02.10"), // }}, // ThreatIntelligence: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2020.02.10"), // }}, // WmiTool: []*armiotsecurity.PackageDownloadInfo{ // { // Link: to.Ptr("http://microsoft.com/downloadLocation"), // Version: to.Ptr("2020.02.10"), // }}, // } }
Output:
type DefenderSettingsClientCreateOrUpdateOptions ¶ added in v0.2.0
type DefenderSettingsClientCreateOrUpdateOptions struct { }
DefenderSettingsClientCreateOrUpdateOptions contains the optional parameters for the DefenderSettingsClient.CreateOrUpdate method.
type DefenderSettingsClientCreateOrUpdateResponse ¶ added in v0.2.0
type DefenderSettingsClientCreateOrUpdateResponse struct { // IoT Defender settings DefenderSettingsModel }
DefenderSettingsClientCreateOrUpdateResponse contains the response from method DefenderSettingsClient.CreateOrUpdate.
type DefenderSettingsClientDeleteOptions ¶ added in v0.2.0
type DefenderSettingsClientDeleteOptions struct { }
DefenderSettingsClientDeleteOptions contains the optional parameters for the DefenderSettingsClient.Delete method.
type DefenderSettingsClientDeleteResponse ¶ added in v0.2.0
type DefenderSettingsClientDeleteResponse struct { }
DefenderSettingsClientDeleteResponse contains the response from method DefenderSettingsClient.Delete.
type DefenderSettingsClientDownloadManagerActivationOptions ¶ added in v0.2.0
type DefenderSettingsClientDownloadManagerActivationOptions struct { }
DefenderSettingsClientDownloadManagerActivationOptions contains the optional parameters for the DefenderSettingsClient.DownloadManagerActivation method.
type DefenderSettingsClientDownloadManagerActivationResponse ¶ added in v0.2.0
type DefenderSettingsClientDownloadManagerActivationResponse struct { // Body contains the streaming response. Body io.ReadCloser }
DefenderSettingsClientDownloadManagerActivationResponse contains the response from method DefenderSettingsClient.DownloadManagerActivation.
type DefenderSettingsClientGetOptions ¶ added in v0.2.0
type DefenderSettingsClientGetOptions struct { }
DefenderSettingsClientGetOptions contains the optional parameters for the DefenderSettingsClient.Get method.
type DefenderSettingsClientGetResponse ¶ added in v0.2.0
type DefenderSettingsClientGetResponse struct { // IoT Defender settings DefenderSettingsModel }
DefenderSettingsClientGetResponse contains the response from method DefenderSettingsClient.Get.
type DefenderSettingsClientListOptions ¶ added in v0.2.0
type DefenderSettingsClientListOptions struct { }
DefenderSettingsClientListOptions contains the optional parameters for the DefenderSettingsClient.List method.
type DefenderSettingsClientListResponse ¶ added in v0.2.0
type DefenderSettingsClientListResponse struct { // List of IoT Defender settings DefenderSettingsList }
DefenderSettingsClientListResponse contains the response from method DefenderSettingsClient.List.
type DefenderSettingsClientPackageDownloadsOptions ¶ added in v0.2.0
type DefenderSettingsClientPackageDownloadsOptions struct { }
DefenderSettingsClientPackageDownloadsOptions contains the optional parameters for the DefenderSettingsClient.PackageDownloads method.
type DefenderSettingsClientPackageDownloadsResponse ¶ added in v0.2.0
type DefenderSettingsClientPackageDownloadsResponse struct { // Information about package downloads PackageDownloads }
DefenderSettingsClientPackageDownloadsResponse contains the response from method DefenderSettingsClient.PackageDownloads.
type DefenderSettingsList ¶
type DefenderSettingsList struct { // READ-ONLY; List data Value []*DefenderSettingsModel }
DefenderSettingsList - List of IoT Defender settings
func (DefenderSettingsList) MarshalJSON ¶
func (d DefenderSettingsList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DefenderSettingsList.
func (*DefenderSettingsList) UnmarshalJSON ¶ added in v0.6.0
func (d *DefenderSettingsList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DefenderSettingsList.
type DefenderSettingsModel ¶
type DefenderSettingsModel struct { // IoT Defender settings properties Properties *DefenderSettingsProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
DefenderSettingsModel - IoT Defender settings
func (DefenderSettingsModel) MarshalJSON ¶ added in v0.6.0
func (d DefenderSettingsModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DefenderSettingsModel.
func (*DefenderSettingsModel) UnmarshalJSON ¶ added in v0.6.0
func (d *DefenderSettingsModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DefenderSettingsModel.
type DefenderSettingsProperties ¶
type DefenderSettingsProperties struct { // REQUIRED; Size of the device quota. Value is required to be in multiples of 100. DeviceQuota *int32 // REQUIRED; MDE integration configuration MdeIntegration *DefenderSettingsPropertiesMdeIntegration // REQUIRED; The kind of onboarding for the subscription OnboardingKind *OnboardingKind // REQUIRED; Sentinel Workspace Resource Ids SentinelWorkspaceResourceIDs []*string // READ-ONLY; End time of the evaluation period, if such exist EvaluationEndTime *time.Time }
DefenderSettingsProperties - IoT Defender settings properties
func (DefenderSettingsProperties) MarshalJSON ¶
func (d DefenderSettingsProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DefenderSettingsProperties.
func (*DefenderSettingsProperties) UnmarshalJSON ¶
func (d *DefenderSettingsProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DefenderSettingsProperties.
type DefenderSettingsPropertiesMdeIntegration ¶
type DefenderSettingsPropertiesMdeIntegration struct { // REQUIRED; Integration status Status *MdeIntegration }
DefenderSettingsPropertiesMdeIntegration - MDE integration configuration
func (DefenderSettingsPropertiesMdeIntegration) MarshalJSON ¶ added in v0.6.0
func (d DefenderSettingsPropertiesMdeIntegration) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DefenderSettingsPropertiesMdeIntegration.
func (*DefenderSettingsPropertiesMdeIntegration) UnmarshalJSON ¶ added in v0.6.0
func (d *DefenderSettingsPropertiesMdeIntegration) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DefenderSettingsPropertiesMdeIntegration.
type DeviceDataSource ¶
type DeviceDataSource string
DeviceDataSource - Device data source
const ( DeviceDataSourceCorpSensor DeviceDataSource = "CorpSensor" DeviceDataSourceMde DeviceDataSource = "Mde" DeviceDataSourceMicroAgent DeviceDataSource = "MicroAgent" DeviceDataSourceOtSensor DeviceDataSource = "OtSensor" DeviceDataSourceOther DeviceDataSource = "Other" )
func PossibleDeviceDataSourceValues ¶
func PossibleDeviceDataSourceValues() []DeviceDataSource
PossibleDeviceDataSourceValues returns the possible values for the DeviceDataSource const type.
type DeviceGroupList ¶
type DeviceGroupList struct { // READ-ONLY; Link to next page of resources. NextLink *string // READ-ONLY; List data Value []*DeviceGroupModel }
DeviceGroupList - List of device groups
func (DeviceGroupList) MarshalJSON ¶
func (d DeviceGroupList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeviceGroupList.
func (*DeviceGroupList) UnmarshalJSON ¶ added in v0.6.0
func (d *DeviceGroupList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeviceGroupList.
type DeviceGroupModel ¶
type DeviceGroupModel struct { // Device group properties Properties any // 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 }
DeviceGroupModel - Device group
func (DeviceGroupModel) MarshalJSON ¶ added in v0.6.0
func (d DeviceGroupModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeviceGroupModel.
func (*DeviceGroupModel) UnmarshalJSON ¶ added in v0.6.0
func (d *DeviceGroupModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeviceGroupModel.
type DeviceGroupsClient ¶
type DeviceGroupsClient struct {
// contains filtered or unexported fields
}
DeviceGroupsClient contains the methods for the DeviceGroups group. Don't use this type directly, use NewDeviceGroupsClient() instead.
func NewDeviceGroupsClient ¶
func NewDeviceGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeviceGroupsClient, error)
NewDeviceGroupsClient creates a new instance of DeviceGroupsClient 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 (*DeviceGroupsClient) CreateOrUpdate ¶
func (client *DeviceGroupsClient) CreateOrUpdate(ctx context.Context, iotDefenderLocation string, deviceGroupName string, deviceGroupModel DeviceGroupModel, options *DeviceGroupsClientCreateOrUpdateOptions) (DeviceGroupsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update device group If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- iotDefenderLocation - Defender for IoT location
- deviceGroupName - Device group name
- deviceGroupModel - Device group model
- options - DeviceGroupsClientCreateOrUpdateOptions contains the optional parameters for the DeviceGroupsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Put.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDeviceGroupsClient().CreateOrUpdate(ctx, "eastus", "myGroup", armiotsecurity.DeviceGroupModel{ Properties: map[string]any{}, }, 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.DeviceGroupModel = armiotsecurity.DeviceGroupModel{ // Name: to.Ptr("myGroup"), // Type: to.Ptr("Microsoft.IoTSecurity/locations/deviceGroups"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/deviceGroups/myGroup"), // Properties: map[string]any{ // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // } }
Output:
func (*DeviceGroupsClient) Delete ¶
func (client *DeviceGroupsClient) Delete(ctx context.Context, iotDefenderLocation string, deviceGroupName string, options *DeviceGroupsClientDeleteOptions) (DeviceGroupsClientDeleteResponse, error)
Delete - Delete device group If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- iotDefenderLocation - Defender for IoT location
- deviceGroupName - Device group name
- options - DeviceGroupsClientDeleteOptions contains the optional parameters for the DeviceGroupsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Delete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewDeviceGroupsClient().Delete(ctx, "eastus", "myGroup", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*DeviceGroupsClient) Get ¶
func (client *DeviceGroupsClient) Get(ctx context.Context, iotDefenderLocation string, deviceGroupName string, options *DeviceGroupsClientGetOptions) (DeviceGroupsClientGetResponse, error)
Get - Get device group If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- iotDefenderLocation - Defender for IoT location
- deviceGroupName - Device group name
- options - DeviceGroupsClientGetOptions contains the optional parameters for the DeviceGroupsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/Get.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDeviceGroupsClient().Get(ctx, "eastus", "myGroup", 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.DeviceGroupModel = armiotsecurity.DeviceGroupModel{ // Name: to.Ptr("myGroup"), // Type: to.Ptr("Microsoft.IoTSecurity/locations/deviceGroups"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus/deviceGroups/myGroup"), // Properties: map[string]any{ // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // } }
Output:
func (*DeviceGroupsClient) NewListPager ¶ added in v0.4.0
func (client *DeviceGroupsClient) NewListPager(iotDefenderLocation string, options *DeviceGroupsClientListOptions) *runtime.Pager[DeviceGroupsClientListResponse]
NewListPager - List device groups
Generated from API version 2021-02-01-preview
- iotDefenderLocation - Defender for IoT location
- options - DeviceGroupsClientListOptions contains the optional parameters for the DeviceGroupsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/DeviceGroups/List.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDeviceGroupsClient().NewListPager("eastus", 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.DeviceGroupList = armiotsecurity.DeviceGroupList{ // Value: []*armiotsecurity.DeviceGroupModel{ // { // Name: to.Ptr("myGroup"), // Type: to.Ptr("Microsoft.IoTSecurity/locations/deviceGroups"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus/deviceGroups/myGroup"), // Properties: map[string]any{ // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // }}, // } } }
Output:
type DeviceGroupsClientCreateOrUpdateOptions ¶ added in v0.2.0
type DeviceGroupsClientCreateOrUpdateOptions struct { }
DeviceGroupsClientCreateOrUpdateOptions contains the optional parameters for the DeviceGroupsClient.CreateOrUpdate method.
type DeviceGroupsClientCreateOrUpdateResponse ¶ added in v0.2.0
type DeviceGroupsClientCreateOrUpdateResponse struct { // Device group DeviceGroupModel }
DeviceGroupsClientCreateOrUpdateResponse contains the response from method DeviceGroupsClient.CreateOrUpdate.
type DeviceGroupsClientDeleteOptions ¶ added in v0.2.0
type DeviceGroupsClientDeleteOptions struct { }
DeviceGroupsClientDeleteOptions contains the optional parameters for the DeviceGroupsClient.Delete method.
type DeviceGroupsClientDeleteResponse ¶ added in v0.2.0
type DeviceGroupsClientDeleteResponse struct { }
DeviceGroupsClientDeleteResponse contains the response from method DeviceGroupsClient.Delete.
type DeviceGroupsClientGetOptions ¶ added in v0.2.0
type DeviceGroupsClientGetOptions struct { }
DeviceGroupsClientGetOptions contains the optional parameters for the DeviceGroupsClient.Get method.
type DeviceGroupsClientGetResponse ¶ added in v0.2.0
type DeviceGroupsClientGetResponse struct { // Device group DeviceGroupModel }
DeviceGroupsClientGetResponse contains the response from method DeviceGroupsClient.Get.
type DeviceGroupsClientListOptions ¶ added in v0.2.0
type DeviceGroupsClientListOptions struct { }
DeviceGroupsClientListOptions contains the optional parameters for the DeviceGroupsClient.NewListPager method.
type DeviceGroupsClientListResponse ¶ added in v0.2.0
type DeviceGroupsClientListResponse struct { // List of device groups DeviceGroupList }
DeviceGroupsClientListResponse contains the response from method DeviceGroupsClient.NewListPager.
type DeviceList ¶
type DeviceList struct { // READ-ONLY; When there are too many devices for one page, use this URI to fetch the next page. NextLink *string // READ-ONLY; List data Value []*DeviceModel }
DeviceList - List of devices
func (DeviceList) MarshalJSON ¶
func (d DeviceList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeviceList.
func (*DeviceList) UnmarshalJSON ¶ added in v0.6.0
func (d *DeviceList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeviceList.
type DeviceModel ¶
type DeviceModel struct { // Device properties Properties *DeviceProperties // 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 }
DeviceModel - Device
func (DeviceModel) MarshalJSON ¶ added in v0.6.0
func (d DeviceModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeviceModel.
func (*DeviceModel) UnmarshalJSON ¶ added in v0.6.0
func (d *DeviceModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeviceModel.
type DeviceProperties ¶
type DeviceProperties struct { // A bag of fields which extends the device information. AdditionalFields any // Authorized state of the device. AuthorizedState *AuthorizedState // Device business function BusinessFunction *string // Device criticality. Criticality *Criticality // Device category id DeviceCategoryID *int32 // Device name DeviceName *string // Device sub type id DeviceSubTypeID *int32 // Device tags DeviceTags []*string // Device type id DeviceTypeID *int32 // List of device firmwares. Firmwares []*Firmware // Device hardware data Hardware *Hardware // Device operating system data OperatingSystem *OperatingSystem // List of device packages Packages []*Package // Purdue level of the device. PurdueLevel *PurdueLevel // READ-ONLY; List of Common Platform Enumeration (CPE) Cpes []*string // READ-ONLY; Device category display name DeviceCategoryDisplayName *string // READ-ONLY; Device data source. DeviceDataSource *DeviceDataSource // READ-ONLY; Device status. DeviceStatus *DeviceStatus // READ-ONLY; Device sub type display name DeviceSubTypeDisplayName *string // READ-ONLY; Device type display name DeviceTypeDisplayName *string // READ-ONLY; First time the device was seen. FirstSeen *time.Time // READ-ONLY; last time the device was programming or programed. LastProgrammingTime *time.Time // READ-ONLY; Last time the device was seen. LastSeen *time.Time // READ-ONLY; Last time the device was updated by the profiler. LastUpdated *time.Time // READ-ONLY; List of merged devices data MergedDevices []*MergedDevice // READ-ONLY; The device Id that this device was merged into MergedToDeviceID *string // READ-ONLY; List of the device network interface cards. Nics []*Nic // READ-ONLY; Device onboarding status. OnboardingStatus *OnboardingStatus // READ-ONLY; For nested device, this is the parent device id. ParentDeviceID *string // READ-ONLY; For nested device, this is the rack number in the parent device that holds the nested device. ParentRackNumber *int32 // READ-ONLY; For nested device, this is the slot number in the parent device that holds the nested device. ParentSlotNumber *int32 // READ-ONLY; Confidence of the device profile ProfilingConfidence *int32 // READ-ONLY; Indicates whether this device is programming ProgrammingState *ProgrammingState // READ-ONLY; risk score of the device. RiskScore *int32 // READ-ONLY; Version of the device model schema SchemaVersion *string // READ-ONLY; Sensor that scanned this device. Sensor *Sensor // READ-ONLY; List of the device slot in the backplane Slots []*Slot }
DeviceProperties - Device properties
func (DeviceProperties) MarshalJSON ¶
func (d DeviceProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DeviceProperties.
func (*DeviceProperties) UnmarshalJSON ¶
func (d *DeviceProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DeviceProperties.
type DeviceStatus ¶
type DeviceStatus string
DeviceStatus - Device status.
const ( DeviceStatusActive DeviceStatus = "Active" DeviceStatusDeleted DeviceStatus = "Deleted" DeviceStatusInactive DeviceStatus = "Inactive" DeviceStatusRemoved DeviceStatus = "Removed" )
func PossibleDeviceStatusValues ¶
func PossibleDeviceStatusValues() []DeviceStatus
PossibleDeviceStatusValues returns the possible values for the DeviceStatus const type.
type DevicesClient ¶
type DevicesClient struct {
// contains filtered or unexported fields
}
DevicesClient contains the methods for the Devices group. Don't use this type directly, use NewDevicesClient() instead.
func NewDevicesClient ¶
func NewDevicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DevicesClient, error)
NewDevicesClient creates a new instance of DevicesClient 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 (*DevicesClient) Get ¶
func (client *DevicesClient) Get(ctx context.Context, iotDefenderLocation string, deviceGroupName string, deviceID string, options *DevicesClientGetOptions) (DevicesClientGetResponse, error)
Get - Get device If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- iotDefenderLocation - Defender for IoT location
- deviceGroupName - Device group name
- deviceID - Device Id
- options - DevicesClientGetOptions contains the optional parameters for the DevicesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Devices/Get.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewDevicesClient().Get(ctx, "eastus", "myGroup", "fa30e727-16e1-4e81-84f1-d26b9153d1b2", 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.DeviceModel = armiotsecurity.DeviceModel{ // Name: to.Ptr("fa30e727-16e1-4e81-84f1-d26b9153d1b2"), // Type: to.Ptr("Microsoft.IoTSecurity/locations/deviceGroups/devices"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus/deviceGroups/myGroup/devices/fa30e727-16e1-4e81-84f1-d26b9153d1b2"), // Properties: &armiotsecurity.DeviceProperties{ // AuthorizedState: to.Ptr(armiotsecurity.AuthorizedStateAuthorized), // Criticality: to.Ptr(armiotsecurity.CriticalityNormal), // DeviceCategoryDisplayName: to.Ptr("OT"), // DeviceCategoryID: to.Ptr[int32](6), // DeviceDataSource: to.Ptr(armiotsecurity.DeviceDataSourceOtSensor), // DeviceName: to.Ptr("10.168.140.1"), // DeviceStatus: to.Ptr(armiotsecurity.DeviceStatusActive), // DeviceSubTypeDisplayName: to.Ptr("Historian"), // DeviceSubTypeID: to.Ptr[int32](2), // DeviceTypeDisplayName: to.Ptr("Industrial"), // DeviceTypeID: to.Ptr[int32](17), // FirstSeen: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-13T06:32:25.000Z"); return t}()), // LastSeen: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-13T06:32:25.000Z"); return t}()), // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-13T06:32:25.000Z"); return t}()), // Nics: []*armiotsecurity.Nic{ // { // IPv4Address: to.Ptr("10.168.140.1"), // LastSeen: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-13T06:32:25.000Z"); return t}()), // MacAddress: to.Ptr("34-E1-2D-77-80-D0"), // MacCertainty: to.Ptr(armiotsecurity.MacCertaintyCertain), // Vlans: []*string{ // to.Ptr("name(1)->2"), // to.Ptr("3"), // to.Ptr("another_name(4)")}, // }}, // OnboardingStatus: to.Ptr(armiotsecurity.OnboardingStatusInsufficientInfo), // OperatingSystem: &armiotsecurity.OperatingSystem{ // Platform: to.Ptr("Windows"), // Version: to.Ptr("10\\1604"), // }, // ProgrammingState: to.Ptr(armiotsecurity.ProgrammingStateNotProgrammingDevice), // PurdueLevel: to.Ptr(armiotsecurity.PurdueLevelProcessControl), // RiskScore: to.Ptr[int32](90), // SchemaVersion: to.Ptr("1"), // Sensor: &armiotsecurity.Sensor{ // Name: to.Ptr("mySensor"), // Site: to.Ptr("mySite"), // Zone: to.Ptr("myZone"), // }, // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // } }
Output:
func (*DevicesClient) NewListPager ¶ added in v0.4.0
func (client *DevicesClient) NewListPager(iotDefenderLocation string, deviceGroupName string, options *DevicesClientListOptions) *runtime.Pager[DevicesClientListResponse]
NewListPager - List devices
Generated from API version 2021-02-01-preview
- iotDefenderLocation - Defender for IoT location
- deviceGroupName - Device group name
- options - DevicesClientListOptions contains the optional parameters for the DevicesClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Devices/List.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewDevicesClient().NewListPager("eastus", "myGroup", &armiotsecurity.DevicesClientListOptions{SkipToken: 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.DeviceList = armiotsecurity.DeviceList{ // Value: []*armiotsecurity.DeviceModel{ // { // Name: to.Ptr("fa30e727-16e1-4e81-84f1-d26b9153d1b2"), // Type: to.Ptr("Microsoft.IoTSecurity/locations/deviceGroups/devices"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus/deviceGroups/myGroup/devices/fa30e727-16e1-4e81-84f1-d26b9153d1b2"), // Properties: &armiotsecurity.DeviceProperties{ // AuthorizedState: to.Ptr(armiotsecurity.AuthorizedStateAuthorized), // Criticality: to.Ptr(armiotsecurity.CriticalityNormal), // DeviceCategoryDisplayName: to.Ptr("OT"), // DeviceCategoryID: to.Ptr[int32](6), // DeviceDataSource: to.Ptr(armiotsecurity.DeviceDataSourceOtSensor), // DeviceName: to.Ptr("10.168.140.1"), // DeviceStatus: to.Ptr(armiotsecurity.DeviceStatusActive), // DeviceSubTypeDisplayName: to.Ptr("Historian"), // DeviceSubTypeID: to.Ptr[int32](2), // DeviceTypeDisplayName: to.Ptr("Industrial"), // DeviceTypeID: to.Ptr[int32](17), // FirstSeen: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-13T06:32:25.000Z"); return t}()), // LastSeen: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-13T06:32:25.000Z"); return t}()), // LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-13T06:32:25.000Z"); return t}()), // Nics: []*armiotsecurity.Nic{ // { // IPv4Address: to.Ptr("10.168.140.1"), // LastSeen: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-05-13T06:32:25.000Z"); return t}()), // MacAddress: to.Ptr("34-E1-2D-77-80-D0"), // MacCertainty: to.Ptr(armiotsecurity.MacCertaintyCertain), // Vlans: []*string{ // to.Ptr("name(1)->2"), // to.Ptr("3"), // to.Ptr("another_name(4)")}, // }}, // OnboardingStatus: to.Ptr(armiotsecurity.OnboardingStatusInsufficientInfo), // OperatingSystem: &armiotsecurity.OperatingSystem{ // Platform: to.Ptr("Windows"), // Version: to.Ptr("10\\1604"), // }, // ProgrammingState: to.Ptr(armiotsecurity.ProgrammingStateNotProgrammingDevice), // PurdueLevel: to.Ptr(armiotsecurity.PurdueLevelProcessControl), // RiskScore: to.Ptr[int32](90), // SchemaVersion: to.Ptr("1"), // Sensor: &armiotsecurity.Sensor{ // Name: to.Ptr("mySensor"), // Site: to.Ptr("mySite"), // Zone: to.Ptr("myZone"), // }, // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // }}, // } } }
Output:
type DevicesClientGetOptions ¶ added in v0.2.0
type DevicesClientGetOptions struct { }
DevicesClientGetOptions contains the optional parameters for the DevicesClient.Get method.
type DevicesClientGetResponse ¶ added in v0.2.0
type DevicesClientGetResponse struct { // Device DeviceModel }
DevicesClientGetResponse contains the response from method DevicesClient.Get.
type DevicesClientListOptions ¶ added in v0.2.0
type DevicesClientListOptions struct { // Skip token used for pagination SkipToken *string }
DevicesClientListOptions contains the optional parameters for the DevicesClient.NewListPager method.
type DevicesClientListResponse ¶ added in v0.2.0
type DevicesClientListResponse struct { // List of devices DeviceList }
DevicesClientListResponse contains the response from method DevicesClient.NewListPager.
type DimensionProperties ¶
type DimensionProperties struct { // localized display name of the dimension to customer DisplayName *string // dimension name Name *string // flag indicating whether this dimension should be included to the customer in Azure Monitor logs (aka Shoebox) ToBeExportedForCustomer *bool }
DimensionProperties - properties for dimension
func (DimensionProperties) MarshalJSON ¶ added in v0.6.0
func (d DimensionProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type DimensionProperties.
func (*DimensionProperties) UnmarshalJSON ¶ added in v0.6.0
func (d *DimensionProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type DimensionProperties.
type ErrorAdditionalInfo ¶
type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. Info any // READ-ONLY; The additional info type. Type *string }
ErrorAdditionalInfo - The resource management error additional info.
func (ErrorAdditionalInfo) MarshalJSON ¶ added in v0.6.0
func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo.
func (*ErrorAdditionalInfo) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo.
type ErrorDetail ¶
type ErrorDetail struct { // READ-ONLY; The error additional info. AdditionalInfo []*ErrorAdditionalInfo // READ-ONLY; The error code. Code *string // READ-ONLY; The error details. Details []*ErrorDetail // READ-ONLY; The error message. Message *string // READ-ONLY; The error target. Target *string }
ErrorDetail - The error detail.
func (ErrorDetail) MarshalJSON ¶
func (e ErrorDetail) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorDetail.
func (*ErrorDetail) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorDetail) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail.
type ErrorModel ¶
type ErrorModel struct { // READ-ONLY; Gets or sets the code. Code *string // READ-ONLY; Gets or sets the details. Details []*ErrorModel // READ-ONLY; Gets or sets the messages. Message *string // READ-ONLY; Gets or sets the target. Target *string }
ErrorModel - Default error model
func (ErrorModel) MarshalJSON ¶
func (e ErrorModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorModel.
func (*ErrorModel) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorModel.
type ErrorResponse ¶
type ErrorResponse struct { // The error object. Error *ErrorDetail }
ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).
func (ErrorResponse) MarshalJSON ¶ added in v0.6.0
func (e ErrorResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponse.
func (*ErrorResponse) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse.
type ErrorResponseModel ¶
type ErrorResponseModel struct { // READ-ONLY; Gets or sets the error. Error *ErrorResponseModelError }
ErrorResponseModel - Default error response model
func (ErrorResponseModel) MarshalJSON ¶ added in v0.6.0
func (e ErrorResponseModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponseModel.
func (*ErrorResponseModel) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorResponseModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseModel.
type ErrorResponseModelError ¶
type ErrorResponseModelError struct { // READ-ONLY; Gets or sets the code. Code *string // READ-ONLY; Gets or sets the details. Details []*ErrorModel // READ-ONLY; Gets or sets the messages. Message *string // READ-ONLY; Gets or sets the target. Target *string }
ErrorResponseModelError - Gets or sets the error.
func (ErrorResponseModelError) MarshalJSON ¶ added in v0.2.0
func (e ErrorResponseModelError) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ErrorResponseModelError.
func (*ErrorResponseModelError) UnmarshalJSON ¶ added in v0.6.0
func (e *ErrorResponseModelError) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseModelError.
type Firmware ¶
type Firmware struct { // A bag of fields which extends the firmware information. AdditionalFields any // Firmware module address. ModuleAddress *string // Firmware name. Name *string // Firmware serial. Serial *string // Firmware vendor. Vendor *string // Firmware version. Version *string }
Firmware - Device firmware data
func (Firmware) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Firmware.
func (*Firmware) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Firmware.
type Hardware ¶
type Hardware struct { // Hardware model. Model *string // Hardware serial number. SerialNumber *string // Hardware vendor. Vendor *string }
Hardware - Device hardware data
func (Hardware) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Hardware.
func (*Hardware) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Hardware.
type LocationList ¶
type LocationList struct { // READ-ONLY; Link to next page of resources. NextLink *string // READ-ONLY; List data Value []*LocationModel }
LocationList - List of Defender for IoT locations
func (LocationList) MarshalJSON ¶
func (l LocationList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LocationList.
func (*LocationList) UnmarshalJSON ¶ added in v0.6.0
func (l *LocationList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LocationList.
type LocationModel ¶
type LocationModel struct { // IoT Defender location properties Properties any // 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 }
LocationModel - IoT Defender location
func (LocationModel) MarshalJSON ¶ added in v0.6.0
func (l LocationModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type LocationModel.
func (*LocationModel) UnmarshalJSON ¶ added in v0.6.0
func (l *LocationModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type LocationModel.
type LocationsClient ¶
type LocationsClient struct {
// contains filtered or unexported fields
}
LocationsClient contains the methods for the Locations group. Don't use this type directly, use NewLocationsClient() instead.
func NewLocationsClient ¶
func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationsClient, error)
NewLocationsClient creates a new instance of LocationsClient 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 (*LocationsClient) Get ¶
func (client *LocationsClient) Get(ctx context.Context, iotDefenderLocation string, options *LocationsClientGetOptions) (LocationsClientGetResponse, error)
Get - Get a Defender for IoT location associated with the given subscription. If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- iotDefenderLocation - Defender for IoT location
- options - LocationsClientGetOptions contains the optional parameters for the LocationsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Locations/Get.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewLocationsClient().Get(ctx, "eastus", 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.LocationModel = armiotsecurity.LocationModel{ // Name: to.Ptr("eastus"), // Type: to.Ptr("Microsoft.IoTSecurity/locations"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus"), // Properties: map[string]any{ // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // } }
Output:
func (*LocationsClient) NewListPager ¶ added in v0.4.0
func (client *LocationsClient) NewListPager(options *LocationsClientListOptions) *runtime.Pager[LocationsClientListResponse]
NewListPager - Lists Defender for IoT locations associated with the given subscription.
Generated from API version 2021-02-01-preview
- options - LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Locations/List.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } pager := clientFactory.NewLocationsClient().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.LocationList = armiotsecurity.LocationList{ // Value: []*armiotsecurity.LocationModel{ // { // Name: to.Ptr("eastus"), // Type: to.Ptr("Microsoft.IoTSecurity/locations"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/locations/eastus"), // Properties: map[string]any{ // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // }}, // } } }
Output:
type LocationsClientGetOptions ¶ added in v0.2.0
type LocationsClientGetOptions struct { }
LocationsClientGetOptions contains the optional parameters for the LocationsClient.Get method.
type LocationsClientGetResponse ¶ added in v0.2.0
type LocationsClientGetResponse struct { // IoT Defender location LocationModel }
LocationsClientGetResponse contains the response from method LocationsClient.Get.
type LocationsClientListOptions ¶ added in v0.2.0
type LocationsClientListOptions struct { }
LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method.
type LocationsClientListResponse ¶ added in v0.2.0
type LocationsClientListResponse struct { // List of Defender for IoT locations LocationList }
LocationsClientListResponse contains the response from method LocationsClient.NewListPager.
type MacCertainty ¶
type MacCertainty string
MacCertainty - Indicates whether the association of the mac to the ip address is certain or a guess.
const ( MacCertaintyCertain MacCertainty = "Certain" MacCertaintyGuess MacCertainty = "Guess" )
func PossibleMacCertaintyValues ¶
func PossibleMacCertaintyValues() []MacCertainty
PossibleMacCertaintyValues returns the possible values for the MacCertainty const type.
type MdeIntegration ¶
type MdeIntegration string
MdeIntegration - Integration status
const ( MdeIntegrationDisabled MdeIntegration = "Disabled" MdeIntegrationEnabled MdeIntegration = "Enabled" )
func PossibleMdeIntegrationValues ¶
func PossibleMdeIntegrationValues() []MdeIntegration
PossibleMdeIntegrationValues returns the possible values for the MdeIntegration const type.
type MergedDevice ¶
type MergedDevice struct { // READ-ONLY; Device data source DeviceDataSource *DeviceDataSource // READ-ONLY; device id ID *string // READ-ONLY; Device sensor data Sensor *Sensor }
MergedDevice - Merged device data
func (MergedDevice) MarshalJSON ¶ added in v0.6.0
func (m MergedDevice) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type MergedDevice.
func (*MergedDevice) UnmarshalJSON ¶ added in v0.6.0
func (m *MergedDevice) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type MergedDevice.
type Nic ¶
type Nic struct { // READ-ONLY; Ipv4 address IPv4Address *string // READ-ONLY; Ipv6 address IPv6Address *string // READ-ONLY; Last seen time LastSeen *time.Time // READ-ONLY; Mac address MacAddress *string // READ-ONLY; Indicates whether the association of the mac to the ip address is certain or a guess. MacCertainty *MacCertainty // READ-ONLY; Network adapter vendor. NetworkAdapterVendor *string // READ-ONLY; List of virtual LAN (vlan) Vlans []*string }
Nic - Network interface card properties
func (Nic) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Nic.
func (*Nic) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface for type Nic.
type OnPremiseSensor ¶
type OnPremiseSensor struct { // On-premise IoT sensor properties Properties any // 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 }
OnPremiseSensor - On-premise IoT sensor
func (OnPremiseSensor) MarshalJSON ¶ added in v0.6.0
func (o OnPremiseSensor) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OnPremiseSensor.
func (*OnPremiseSensor) UnmarshalJSON ¶ added in v0.6.0
func (o *OnPremiseSensor) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OnPremiseSensor.
type OnPremiseSensorsClient ¶
type OnPremiseSensorsClient struct {
// contains filtered or unexported fields
}
OnPremiseSensorsClient contains the methods for the OnPremiseSensors group. Don't use this type directly, use NewOnPremiseSensorsClient() instead.
func NewOnPremiseSensorsClient ¶
func NewOnPremiseSensorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OnPremiseSensorsClient, error)
NewOnPremiseSensorsClient creates a new instance of OnPremiseSensorsClient 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 (*OnPremiseSensorsClient) CreateOrUpdate ¶
func (client *OnPremiseSensorsClient) CreateOrUpdate(ctx context.Context, onPremiseSensorName string, options *OnPremiseSensorsClientCreateOrUpdateOptions) (OnPremiseSensorsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update on-premise IoT sensor If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- onPremiseSensorName - Name of the on-premise IoT sensor
- options - OnPremiseSensorsClientCreateOrUpdateOptions contains the optional parameters for the OnPremiseSensorsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/OnPremiseSensors/Put.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewOnPremiseSensorsClient().CreateOrUpdate(ctx, "mySensor", 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.OnPremiseSensor = armiotsecurity.OnPremiseSensor{ // Name: to.Ptr("mySensor"), // Type: to.Ptr("Microsoft.IoTSecurity/onPremiseSensors"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/sensors/mySensor"), // Properties: map[string]any{ // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // } }
Output:
func (*OnPremiseSensorsClient) Delete ¶
func (client *OnPremiseSensorsClient) Delete(ctx context.Context, onPremiseSensorName string, options *OnPremiseSensorsClientDeleteOptions) (OnPremiseSensorsClientDeleteResponse, error)
Delete - Delete on-premise IoT sensor If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- onPremiseSensorName - Name of the on-premise IoT sensor
- options - OnPremiseSensorsClientDeleteOptions contains the optional parameters for the OnPremiseSensorsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/OnPremiseSensors/Delete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewOnPremiseSensorsClient().Delete(ctx, "mySensor", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*OnPremiseSensorsClient) DownloadActivation ¶
func (client *OnPremiseSensorsClient) DownloadActivation(ctx context.Context, onPremiseSensorName string, options *OnPremiseSensorsClientDownloadActivationOptions) (OnPremiseSensorsClientDownloadActivationResponse, error)
DownloadActivation - Download sensor activation file If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- onPremiseSensorName - Name of the on-premise IoT sensor
- options - OnPremiseSensorsClientDownloadActivationOptions contains the optional parameters for the OnPremiseSensorsClient.DownloadActivation method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/OnPremiseSensors/DownloadActivation.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewOnPremiseSensorsClient().DownloadActivation(ctx, "mySensor", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*OnPremiseSensorsClient) DownloadResetPassword ¶
func (client *OnPremiseSensorsClient) DownloadResetPassword(ctx context.Context, onPremiseSensorName string, body ResetPasswordInput, options *OnPremiseSensorsClientDownloadResetPasswordOptions) (OnPremiseSensorsClientDownloadResetPasswordResponse, error)
DownloadResetPassword - Download file for reset password of the sensor If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- onPremiseSensorName - Name of the on-premise IoT sensor
- body - Input for reset password.
- options - OnPremiseSensorsClientDownloadResetPasswordOptions contains the optional parameters for the OnPremiseSensorsClient.DownloadResetPassword method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/OnPremiseSensors/DownloadResetPassword.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/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewOnPremiseSensorsClient().DownloadResetPassword(ctx, "mySensor", armiotsecurity.ResetPasswordInput{ ApplianceID: to.Ptr("3214-528AV23-D121-D3-E1"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*OnPremiseSensorsClient) Get ¶
func (client *OnPremiseSensorsClient) Get(ctx context.Context, onPremiseSensorName string, options *OnPremiseSensorsClientGetOptions) (OnPremiseSensorsClientGetResponse, error)
Get - Get on-premise IoT sensor If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- onPremiseSensorName - Name of the on-premise IoT sensor
- options - OnPremiseSensorsClientGetOptions contains the optional parameters for the OnPremiseSensorsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/OnPremiseSensors/Get.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewOnPremiseSensorsClient().Get(ctx, "mySensor", 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.OnPremiseSensor = armiotsecurity.OnPremiseSensor{ // Name: to.Ptr("mySensor"), // Type: to.Ptr("Microsoft.IoTSecurity/onPremiseSensors"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/onPremiseSensors/mySensor"), // Properties: map[string]any{ // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // } }
Output:
func (*OnPremiseSensorsClient) List ¶
func (client *OnPremiseSensorsClient) List(ctx context.Context, options *OnPremiseSensorsClientListOptions) (OnPremiseSensorsClientListResponse, error)
List - List on-premise IoT sensors If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- options - OnPremiseSensorsClientListOptions contains the optional parameters for the OnPremiseSensorsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/OnPremiseSensors/List.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewOnPremiseSensorsClient().List(ctx, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.OnPremiseSensorsList = armiotsecurity.OnPremiseSensorsList{ // Value: []*armiotsecurity.OnPremiseSensor{ // { // Name: to.Ptr("mySensor"), // Type: to.Ptr("Microsoft.IoTSecurity/onPremiseSensors"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/sensors/mySensor"), // Properties: map[string]any{ // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("otherSensor"), // Type: to.Ptr("Microsoft.IoTSecurity/onPremiseSensors"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.IoTSecurity/sensors/otherSensor"), // Properties: map[string]any{ // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // }}, // } }
Output:
type OnPremiseSensorsClientCreateOrUpdateOptions ¶ added in v0.2.0
type OnPremiseSensorsClientCreateOrUpdateOptions struct { }
OnPremiseSensorsClientCreateOrUpdateOptions contains the optional parameters for the OnPremiseSensorsClient.CreateOrUpdate method.
type OnPremiseSensorsClientCreateOrUpdateResponse ¶ added in v0.2.0
type OnPremiseSensorsClientCreateOrUpdateResponse struct { // On-premise IoT sensor OnPremiseSensor }
OnPremiseSensorsClientCreateOrUpdateResponse contains the response from method OnPremiseSensorsClient.CreateOrUpdate.
type OnPremiseSensorsClientDeleteOptions ¶ added in v0.2.0
type OnPremiseSensorsClientDeleteOptions struct { }
OnPremiseSensorsClientDeleteOptions contains the optional parameters for the OnPremiseSensorsClient.Delete method.
type OnPremiseSensorsClientDeleteResponse ¶ added in v0.2.0
type OnPremiseSensorsClientDeleteResponse struct { }
OnPremiseSensorsClientDeleteResponse contains the response from method OnPremiseSensorsClient.Delete.
type OnPremiseSensorsClientDownloadActivationOptions ¶ added in v0.2.0
type OnPremiseSensorsClientDownloadActivationOptions struct { }
OnPremiseSensorsClientDownloadActivationOptions contains the optional parameters for the OnPremiseSensorsClient.DownloadActivation method.
type OnPremiseSensorsClientDownloadActivationResponse ¶ added in v0.2.0
type OnPremiseSensorsClientDownloadActivationResponse struct { // Body contains the streaming response. Body io.ReadCloser }
OnPremiseSensorsClientDownloadActivationResponse contains the response from method OnPremiseSensorsClient.DownloadActivation.
type OnPremiseSensorsClientDownloadResetPasswordOptions ¶ added in v0.2.0
type OnPremiseSensorsClientDownloadResetPasswordOptions struct { }
OnPremiseSensorsClientDownloadResetPasswordOptions contains the optional parameters for the OnPremiseSensorsClient.DownloadResetPassword method.
type OnPremiseSensorsClientDownloadResetPasswordResponse ¶ added in v0.2.0
type OnPremiseSensorsClientDownloadResetPasswordResponse struct { // Body contains the streaming response. Body io.ReadCloser }
OnPremiseSensorsClientDownloadResetPasswordResponse contains the response from method OnPremiseSensorsClient.DownloadResetPassword.
type OnPremiseSensorsClientGetOptions ¶ added in v0.2.0
type OnPremiseSensorsClientGetOptions struct { }
OnPremiseSensorsClientGetOptions contains the optional parameters for the OnPremiseSensorsClient.Get method.
type OnPremiseSensorsClientGetResponse ¶ added in v0.2.0
type OnPremiseSensorsClientGetResponse struct { // On-premise IoT sensor OnPremiseSensor }
OnPremiseSensorsClientGetResponse contains the response from method OnPremiseSensorsClient.Get.
type OnPremiseSensorsClientListOptions ¶ added in v0.2.0
type OnPremiseSensorsClientListOptions struct { }
OnPremiseSensorsClientListOptions contains the optional parameters for the OnPremiseSensorsClient.List method.
type OnPremiseSensorsClientListResponse ¶ added in v0.2.0
type OnPremiseSensorsClientListResponse struct { // List of on-premise IoT sensors OnPremiseSensorsList }
OnPremiseSensorsClientListResponse contains the response from method OnPremiseSensorsClient.List.
type OnPremiseSensorsList ¶
type OnPremiseSensorsList struct { // READ-ONLY; List data Value []*OnPremiseSensor }
OnPremiseSensorsList - List of on-premise IoT sensors
func (OnPremiseSensorsList) MarshalJSON ¶
func (o OnPremiseSensorsList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OnPremiseSensorsList.
func (*OnPremiseSensorsList) UnmarshalJSON ¶ added in v0.6.0
func (o *OnPremiseSensorsList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OnPremiseSensorsList.
type OnboardingKind ¶
type OnboardingKind string
OnboardingKind - The kind of onboarding for the subscription
const ( OnboardingKindDefault OnboardingKind = "Default" OnboardingKindEvaluation OnboardingKind = "Evaluation" OnboardingKindMigratedToAzure OnboardingKind = "MigratedToAzure" OnboardingKindPurchased OnboardingKind = "Purchased" )
func PossibleOnboardingKindValues ¶
func PossibleOnboardingKindValues() []OnboardingKind
PossibleOnboardingKindValues returns the possible values for the OnboardingKind const type.
type OnboardingStatus ¶
type OnboardingStatus string
OnboardingStatus - Device onboarding status.
const ( OnboardingStatusInsufficientInfo OnboardingStatus = "InsufficientInfo" OnboardingStatusNotOnboarded OnboardingStatus = "NotOnboarded" OnboardingStatusNotSupported OnboardingStatus = "NotSupported" OnboardingStatusOnboarded OnboardingStatus = "Onboarded" )
func PossibleOnboardingStatusValues ¶
func PossibleOnboardingStatusValues() []OnboardingStatus
PossibleOnboardingStatusValues returns the possible values for the OnboardingStatus const type.
type OperatingSystem ¶
type OperatingSystem struct { // OS architecture Architecture *string // OS build Build *string // OS distribution Distribution *string // OS platform Platform *string // OS version Version *string }
OperatingSystem - Device operating system data
func (OperatingSystem) MarshalJSON ¶ added in v0.6.0
func (o OperatingSystem) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperatingSystem.
func (*OperatingSystem) UnmarshalJSON ¶ added in v0.6.0
func (o *OperatingSystem) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperatingSystem.
type Operation ¶
type Operation struct { // Properties on the operation Display *OperationDisplay // Whether operation is a data action IsDataAction *bool // Operation name for display purposes Name *string // origin of the operation Origin *string // properties for the operation meta info Properties *OperationProperties }
Operation resource
func (Operation) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Operation.
func (*Operation) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Operation.
type OperationDisplay ¶
type OperationDisplay struct { // Description of the operation for display purposes Description *string // Name of the operation for display purposes Operation *string // Name of the provider for display purposes Provider *string // Name of the resource type for display purposes Resource *string }
OperationDisplay - The response model for get operation properties
func (OperationDisplay) MarshalJSON ¶ added in v0.6.0
func (o OperationDisplay) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationDisplay.
func (*OperationDisplay) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationDisplay) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.
type OperationList ¶
type OperationList struct { // REQUIRED; Collection of items of type results. Value []*Operation // Total item count. Count *int64 // The Url of next result page. NextLink *string }
OperationList - Paged list of operation resources
func (OperationList) MarshalJSON ¶
func (o OperationList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationList.
func (*OperationList) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationList.
type OperationMetaLogSpecification ¶
type OperationMetaLogSpecification struct { // blob duration of the log BlobDuration *string // localized name of the log category DisplayName *string // name of the log category Name *string }
OperationMetaLogSpecification - log specifications for operation api
func (OperationMetaLogSpecification) MarshalJSON ¶ added in v0.6.0
func (o OperationMetaLogSpecification) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationMetaLogSpecification.
func (*OperationMetaLogSpecification) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationMetaLogSpecification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetaLogSpecification.
type OperationMetaMetricSpecification ¶
type OperationMetaMetricSpecification struct { // aggregation type of metric AggregationType *string // properties for dimension Dimensions []*DimensionProperties // description of the metric DisplayDescription *string // localized name of the metric DisplayName *string // enable regional mdm account EnableRegionalMdmAccount *string // internal metric name InternalMetricName *string // name of the metric Name *string // dimension name use to replace resource id if specified ResourceIDDimensionNameOverride *string // Metric namespace. Only set the namespace if different from the default value, leaving it empty makes it use the value from // the ARM manifest. SourceMdmNamespace *string // supported aggregation types SupportedAggregationTypes []*string // supported time grain types SupportedTimeGrainTypes []*string // units for the metric Unit *string }
OperationMetaMetricSpecification - metric specifications for the operation
func (OperationMetaMetricSpecification) MarshalJSON ¶
func (o OperationMetaMetricSpecification) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationMetaMetricSpecification.
func (*OperationMetaMetricSpecification) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationMetaMetricSpecification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetaMetricSpecification.
type OperationMetaServiceSpecification ¶
type OperationMetaServiceSpecification struct { // log specifications for the operation LogSpecifications []*OperationMetaLogSpecification // metric specifications for the operation MetricSpecifications []*OperationMetaMetricSpecification }
OperationMetaServiceSpecification - The operation meta service specification
func (OperationMetaServiceSpecification) MarshalJSON ¶
func (o OperationMetaServiceSpecification) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationMetaServiceSpecification.
func (*OperationMetaServiceSpecification) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationMetaServiceSpecification) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetaServiceSpecification.
type OperationProperties ¶
type OperationProperties struct { // meta service specification ServiceSpecification *OperationMetaServiceSpecification }
OperationProperties - properties on meta info
func (OperationProperties) MarshalJSON ¶ added in v0.6.0
func (o OperationProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type OperationProperties.
func (*OperationProperties) UnmarshalJSON ¶ added in v0.6.0
func (o *OperationProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties.
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 ¶ added in v0.4.0
func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]
NewListPager - List of available operations
Generated from API version 2021-02-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/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Operations/List.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.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.OperationList = armiotsecurity.OperationList{ // Value: []*armiotsecurity.Operation{ // { // Name: to.Ptr("Microsoft.IoTSecurity/unregister/action"), // Display: &armiotsecurity.OperationDisplay{ // Description: to.Ptr("Unregisters the subscription for Azure Defender for IoT"), // Operation: to.Ptr("Unregister Subscription"), // Provider: to.Ptr("Microsoft IoT Security"), // Resource: to.Ptr("Subscription"), // }, // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.IoTSecurity/register/action"), // Display: &armiotsecurity.OperationDisplay{ // Description: to.Ptr("Registers the subscription for Azure Defender for IoT"), // Operation: to.Ptr("Register Subscription"), // Provider: to.Ptr("Microsoft IoT Security"), // Resource: to.Ptr("Subscription"), // }, // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.IoTSecurity/defenderSettings/read"), // Display: &armiotsecurity.OperationDisplay{ // Description: to.Ptr("Gets IoT Defender Settings"), // Operation: to.Ptr("Get IoT Defender Settings"), // Provider: to.Ptr("Microsoft IoT Security"), // Resource: to.Ptr("IoT Defender Settings"), // }, // Origin: to.Ptr("user"), // }, // { // Name: to.Ptr("Microsoft.IoTSecurity/defenderSettings/write"), // Display: &armiotsecurity.OperationDisplay{ // Description: to.Ptr("Creates or updates IoT Defender Settings"), // Operation: to.Ptr("Create or update IoT Defender Settings"), // Provider: to.Ptr("Microsoft IoT Security"), // Resource: to.Ptr("IoT Defender Settings"), // }, // Origin: to.Ptr("user"), // }, // { // Name: to.Ptr("Microsoft.IoTSecurity/defenderSettings/delete"), // Display: &armiotsecurity.OperationDisplay{ // Description: to.Ptr("Deletes IoT Defender Settings"), // Operation: to.Ptr("Delete IoT Defender Settings"), // Provider: to.Ptr("Microsoft IoT Security"), // Resource: to.Ptr("IoT Defender Settings"), // }, // Origin: to.Ptr("user"), // }, // { // Name: to.Ptr("Microsoft.IoTSecurity/defenderSettings/packageDownloads/action"), // Display: &armiotsecurity.OperationDisplay{ // Description: to.Ptr("Gets downloadable IoT Defender packages information"), // Operation: to.Ptr("Get downloadable IoT Defender packages information"), // Provider: to.Ptr("Microsoft IoT Security"), // Resource: to.Ptr("IoT Defender Settings"), // }, // Origin: to.Ptr("user"), // }, // { // Name: to.Ptr("Microsoft.IoTSecurity/defenderSettings/downloadManagerActivation/action"), // Display: &armiotsecurity.OperationDisplay{ // Description: to.Ptr("Download manager activation file"), // Operation: to.Ptr("Download manager activation file"), // Provider: to.Ptr("Microsoft IoT Security"), // Resource: to.Ptr("IoT Defender Settings"), // }, // Origin: to.Ptr("user"), // }}, // } } }
Output:
type OperationsClientListOptions ¶ added in v0.2.0
type OperationsClientListOptions struct { }
OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
type OperationsClientListResponse ¶ added in v0.2.0
type OperationsClientListResponse struct { // Paged list of operation resources OperationList }
OperationsClientListResponse contains the response from method OperationsClient.NewListPager.
type Package ¶
Package - Device package data
func (Package) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Package.
func (*Package) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Package.
type PackageDownloadInfo ¶
type PackageDownloadInfo struct { // READ-ONLY; Download link Link *string // READ-ONLY; Version number Version *string // READ-ONLY; Kind of the version VersionKind *VersionKind }
PackageDownloadInfo - Information on a specific package download
func (PackageDownloadInfo) MarshalJSON ¶ added in v0.6.0
func (p PackageDownloadInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PackageDownloadInfo.
func (*PackageDownloadInfo) UnmarshalJSON ¶ added in v0.6.0
func (p *PackageDownloadInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PackageDownloadInfo.
type PackageDownloads ¶
type PackageDownloads struct { // READ-ONLY; Authorized devices import template AuthorizedDevicesImportTemplate []*PackageDownloadInfo // READ-ONLY; All downloads for Central Manager CentralManager *PackageDownloadsCentralManager // READ-ONLY; Authorized devices import template DeviceInformationUpdateImportTemplate []*PackageDownloadInfo // READ-ONLY; Contains all Sensor binary downloads Sensor *PackageDownloadsSensor // READ-ONLY; SNMP Server file Snmp []*PackageDownloadInfo // READ-ONLY; All downloads for threat intelligence ThreatIntelligence []*PackageDownloadInfo // READ-ONLY; Used for local configuration export WmiTool []*PackageDownloadInfo }
PackageDownloads - Information about package downloads
func (PackageDownloads) MarshalJSON ¶
func (p PackageDownloads) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PackageDownloads.
func (*PackageDownloads) UnmarshalJSON ¶ added in v0.6.0
func (p *PackageDownloads) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PackageDownloads.
type PackageDownloadsCentralManager ¶
type PackageDownloadsCentralManager struct { // READ-ONLY; Contains full package downloads Full *PackageDownloadsCentralManagerFull // READ-ONLY; Central Manager upgrade package downloads (on existing installations) Upgrade []*UpgradePackageDownloadInfo }
PackageDownloadsCentralManager - All downloads for Central Manager
func (PackageDownloadsCentralManager) MarshalJSON ¶
func (p PackageDownloadsCentralManager) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PackageDownloadsCentralManager.
func (*PackageDownloadsCentralManager) UnmarshalJSON ¶ added in v0.6.0
func (p *PackageDownloadsCentralManager) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PackageDownloadsCentralManager.
type PackageDownloadsCentralManagerFull ¶
type PackageDownloadsCentralManagerFull struct { // READ-ONLY; Contains all ISO full versions of the Central Manager Iso []*PackageDownloadInfo // READ-ONLY; Contains all OVF (virtual machine) full versions of the Central Manager Ovf *PackageDownloadsCentralManagerFullOvf }
PackageDownloadsCentralManagerFull - Contains full package downloads
func (PackageDownloadsCentralManagerFull) MarshalJSON ¶
func (p PackageDownloadsCentralManagerFull) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PackageDownloadsCentralManagerFull.
func (*PackageDownloadsCentralManagerFull) UnmarshalJSON ¶ added in v0.6.0
func (p *PackageDownloadsCentralManagerFull) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PackageDownloadsCentralManagerFull.
type PackageDownloadsCentralManagerFullOvf ¶
type PackageDownloadsCentralManagerFullOvf struct { // READ-ONLY; The Enterprise package type Enterprise []*PackageDownloadInfo // READ-ONLY; The EnterpriseHighAvailability package type EnterpriseHighAvailability []*PackageDownloadInfo // READ-ONLY; The Medium package type Medium []*PackageDownloadInfo // READ-ONLY; The MediumHighAvailability package type MediumHighAvailability []*PackageDownloadInfo }
PackageDownloadsCentralManagerFullOvf - Contains all OVF (virtual machine) full versions of the Central Manager
func (PackageDownloadsCentralManagerFullOvf) MarshalJSON ¶
func (p PackageDownloadsCentralManagerFullOvf) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PackageDownloadsCentralManagerFullOvf.
func (*PackageDownloadsCentralManagerFullOvf) UnmarshalJSON ¶ added in v0.6.0
func (p *PackageDownloadsCentralManagerFullOvf) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PackageDownloadsCentralManagerFullOvf.
type PackageDownloadsSensor ¶
type PackageDownloadsSensor struct { // Sensor upgrade package downloads (on existing installations) Upgrade []*UpgradePackageDownloadInfo // READ-ONLY; Contains full package downloads Full *PackageDownloadsSensorFull }
PackageDownloadsSensor - Contains all Sensor binary downloads
func (PackageDownloadsSensor) MarshalJSON ¶
func (p PackageDownloadsSensor) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PackageDownloadsSensor.
func (*PackageDownloadsSensor) UnmarshalJSON ¶ added in v0.6.0
func (p *PackageDownloadsSensor) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PackageDownloadsSensor.
type PackageDownloadsSensorFull ¶
type PackageDownloadsSensorFull struct { // Contains all OVF (virtual machine) full versions for the sensor Ovf *PackageDownloadsSensorFullOvf // READ-ONLY; Contains all ISO full versions for the sensor Iso []*PackageDownloadInfo }
PackageDownloadsSensorFull - Contains full package downloads
func (PackageDownloadsSensorFull) MarshalJSON ¶
func (p PackageDownloadsSensorFull) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PackageDownloadsSensorFull.
func (*PackageDownloadsSensorFull) UnmarshalJSON ¶ added in v0.6.0
func (p *PackageDownloadsSensorFull) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PackageDownloadsSensorFull.
type PackageDownloadsSensorFullOvf ¶
type PackageDownloadsSensorFullOvf struct { // READ-ONLY; Enterprise package type Enterprise []*PackageDownloadInfo // READ-ONLY; Line package type Line []*PackageDownloadInfo // READ-ONLY; Medium package type Medium []*PackageDownloadInfo }
PackageDownloadsSensorFullOvf - Contains all OVF (virtual machine) full versions for the sensor
func (PackageDownloadsSensorFullOvf) MarshalJSON ¶
func (p PackageDownloadsSensorFullOvf) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type PackageDownloadsSensorFullOvf.
func (*PackageDownloadsSensorFullOvf) UnmarshalJSON ¶ added in v0.6.0
func (p *PackageDownloadsSensorFullOvf) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type PackageDownloadsSensorFullOvf.
type ProgrammingState ¶
type ProgrammingState string
ProgrammingState - Indicates whether this device is programming
const ( ProgrammingStateNotProgrammingDevice ProgrammingState = "NotProgrammingDevice" ProgrammingStateProgrammingDevice ProgrammingState = "ProgrammingDevice" )
func PossibleProgrammingStateValues ¶
func PossibleProgrammingStateValues() []ProgrammingState
PossibleProgrammingStateValues returns the possible values for the ProgrammingState const type.
type ProxyResource ¶
type ProxyResource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location
func (ProxyResource) MarshalJSON ¶ added in v0.6.0
func (p ProxyResource) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ProxyResource.
func (*ProxyResource) UnmarshalJSON ¶ added in v0.6.0
func (p *ProxyResource) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource.
type PurdueLevel ¶
type PurdueLevel string
PurdueLevel - Purdue level of the device.
const ( PurdueLevelEnterprise PurdueLevel = "Enterprise" PurdueLevelProcessControl PurdueLevel = "ProcessControl" PurdueLevelSupervisory PurdueLevel = "Supervisory" )
func PossiblePurdueLevelValues ¶
func PossiblePurdueLevelValues() []PurdueLevel
PossiblePurdueLevelValues returns the possible values for the PurdueLevel const type.
type ResetPasswordInput ¶
type ResetPasswordInput struct { // The appliance id of the sensor. ApplianceID *string }
ResetPasswordInput - Reset password input.
func (ResetPasswordInput) MarshalJSON ¶ added in v0.6.0
func (r ResetPasswordInput) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type ResetPasswordInput.
func (*ResetPasswordInput) UnmarshalJSON ¶ added in v0.6.0
func (r *ResetPasswordInput) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type ResetPasswordInput.
type Resource ¶
type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource Name *string // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string }
Resource - Common fields that are returned in the response for all Azure Resource Manager resources
func (Resource) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Resource.
func (*Resource) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Resource.
type Sensor ¶
type Sensor struct { // READ-ONLY; Sensor name. Name *string // READ-ONLY; Sensor site. Site *string // READ-ONLY; Sensor type. Type *SensorType // READ-ONLY; Sensor zone. Zone *string }
Sensor that scanned the device
func (Sensor) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type Sensor.
func (*Sensor) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Sensor.
type SensorModel ¶
type SensorModel struct { // IoT sensor properties Properties *SensorProperties // 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 }
SensorModel - IoT sensor model
func (SensorModel) MarshalJSON ¶ added in v0.6.0
func (s SensorModel) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SensorModel.
func (*SensorModel) UnmarshalJSON ¶ added in v0.6.0
func (s *SensorModel) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SensorModel.
type SensorProperties ¶
type SensorProperties struct { // Type of sensor SensorType *SensorType // TI Automatic mode status of the IoT sensor TiAutomaticUpdates *bool // Zone of the IoT sensor Zone *string // READ-ONLY; Last connectivity time of the IoT sensor ConnectivityTime *string // READ-ONLY; Dynamic mode status of the IoT sensor DynamicLearning *bool // READ-ONLY; Learning mode status of the IoT sensor LearningMode *bool // READ-ONLY; Status of the IoT sensor SensorStatus *SensorStatus // READ-ONLY; Version of the IoT sensor SensorVersion *string // READ-ONLY; TI Status of the IoT sensor TiStatus *TiStatus // READ-ONLY; TI Version of the IoT sensor TiVersion *string }
SensorProperties - IoT sensor properties
func (SensorProperties) MarshalJSON ¶ added in v0.6.0
func (s SensorProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SensorProperties.
func (*SensorProperties) UnmarshalJSON ¶ added in v0.6.0
func (s *SensorProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SensorProperties.
type SensorStatus ¶
type SensorStatus string
SensorStatus - Status of the IoT sensor
const ( SensorStatusDisconnected SensorStatus = "Disconnected" SensorStatusOk SensorStatus = "Ok" )
func PossibleSensorStatusValues ¶
func PossibleSensorStatusValues() []SensorStatus
PossibleSensorStatusValues returns the possible values for the SensorStatus const type.
type SensorType ¶
type SensorType string
SensorType - Type of sensor
const ( SensorTypeEnterprise SensorType = "Enterprise" SensorTypeOt SensorType = "Ot" )
func PossibleSensorTypeValues ¶
func PossibleSensorTypeValues() []SensorType
PossibleSensorTypeValues returns the possible values for the SensorType const type.
type SensorsClient ¶
type SensorsClient struct {
// contains filtered or unexported fields
}
SensorsClient contains the methods for the Sensors group. Don't use this type directly, use NewSensorsClient() instead.
func NewSensorsClient ¶
func NewSensorsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SensorsClient, error)
NewSensorsClient creates a new instance of SensorsClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*SensorsClient) CreateOrUpdate ¶
func (client *SensorsClient) CreateOrUpdate(ctx context.Context, scope string, sensorName string, sensorModel SensorModel, options *SensorsClientCreateOrUpdateOptions) (SensorsClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update IoT sensor If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- scope - Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)
- sensorName - Name of the IoT sensor
- sensorModel - The IoT sensor model
- options - SensorsClientCreateOrUpdateOptions contains the optional parameters for the SensorsClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Sensors/Put.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/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSensorsClient().CreateOrUpdate(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", "mySensor", armiotsecurity.SensorModel{ Properties: &armiotsecurity.SensorProperties{ SensorType: to.Ptr(armiotsecurity.SensorTypeOt), TiAutomaticUpdates: to.Ptr(true), Zone: to.Ptr("Zone Name"), }, }, 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.SensorModel = armiotsecurity.SensorModel{ // Name: to.Ptr("mySensor"), // Type: to.Ptr("Microsoft.IoTSecurity/sensors"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sensors/mySensor"), // Properties: &armiotsecurity.SensorProperties{ // ConnectivityTime: to.Ptr("2020-11-17T12:31:25Z"), // DynamicLearning: to.Ptr(true), // LearningMode: to.Ptr(true), // SensorStatus: to.Ptr(armiotsecurity.SensorStatusOk), // SensorType: to.Ptr(armiotsecurity.SensorTypeOt), // SensorVersion: to.Ptr("2020.11.01.1643"), // TiAutomaticUpdates: to.Ptr(true), // TiStatus: to.Ptr(armiotsecurity.TiStatusOk), // TiVersion: to.Ptr("2020-11-17T12:31:25Z"), // Zone: to.Ptr("Zone Name"), // }, // } }
Output:
func (*SensorsClient) Delete ¶
func (client *SensorsClient) Delete(ctx context.Context, scope string, sensorName string, options *SensorsClientDeleteOptions) (SensorsClientDeleteResponse, error)
Delete - Delete IoT sensor If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- scope - Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)
- sensorName - Name of the IoT sensor
- options - SensorsClientDeleteOptions contains the optional parameters for the SensorsClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Sensors/Delete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewSensorsClient().Delete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", "mySensor", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*SensorsClient) DownloadActivation ¶
func (client *SensorsClient) DownloadActivation(ctx context.Context, scope string, sensorName string, options *SensorsClientDownloadActivationOptions) (SensorsClientDownloadActivationResponse, error)
DownloadActivation - Download sensor activation file If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- scope - Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)
- sensorName - Name of the IoT sensor
- options - SensorsClientDownloadActivationOptions contains the optional parameters for the SensorsClient.DownloadActivation method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Sensors/DownloadActivation.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewSensorsClient().DownloadActivation(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", "mySensor", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*SensorsClient) DownloadResetPassword ¶
func (client *SensorsClient) DownloadResetPassword(ctx context.Context, scope string, sensorName string, body ResetPasswordInput, options *SensorsClientDownloadResetPasswordOptions) (SensorsClientDownloadResetPasswordResponse, error)
DownloadResetPassword - Download file for reset password of the sensor If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- scope - Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)
- sensorName - Name of the IoT sensor
- body - The reset password input.
- options - SensorsClientDownloadResetPasswordOptions contains the optional parameters for the SensorsClient.DownloadResetPassword method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Sensors/DownloadResetPassword.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/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewSensorsClient().DownloadResetPassword(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", "mySensor", armiotsecurity.ResetPasswordInput{ ApplianceID: to.Ptr("3214-528AV23-D121-D3-E1"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*SensorsClient) Get ¶
func (client *SensorsClient) Get(ctx context.Context, scope string, sensorName string, options *SensorsClientGetOptions) (SensorsClientGetResponse, error)
Get - Get IoT sensor If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- scope - Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)
- sensorName - Name of the IoT sensor
- options - SensorsClientGetOptions contains the optional parameters for the SensorsClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Sensors/Get.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSensorsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", "mySensor", 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.SensorModel = armiotsecurity.SensorModel{ // Name: to.Ptr("mySensor"), // Type: to.Ptr("Microsoft.IoTSecurity/sensors"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sensors/mySensor"), // Properties: &armiotsecurity.SensorProperties{ // ConnectivityTime: to.Ptr("2020-11-17T12:31:25Z"), // DynamicLearning: to.Ptr(true), // LearningMode: to.Ptr(true), // SensorStatus: to.Ptr(armiotsecurity.SensorStatusOk), // SensorType: to.Ptr(armiotsecurity.SensorTypeOt), // SensorVersion: to.Ptr("2020.11.01.1643"), // TiAutomaticUpdates: to.Ptr(true), // TiStatus: to.Ptr(armiotsecurity.TiStatusOk), // TiVersion: to.Ptr("2020-11-17T12:31:25Z"), // Zone: to.Ptr("Zone Name"), // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // } }
Output:
func (*SensorsClient) List ¶
func (client *SensorsClient) List(ctx context.Context, scope string, options *SensorsClientListOptions) (SensorsClientListResponse, error)
List - List IoT sensors If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- scope - Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)
- options - SensorsClientListOptions contains the optional parameters for the SensorsClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Sensors/List.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSensorsClient().List(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", 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.SensorsList = armiotsecurity.SensorsList{ // Value: []*armiotsecurity.SensorModel{ // { // Name: to.Ptr("mySensor"), // Type: to.Ptr("Microsoft.IoTSecurity/sensors"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sensors/mySensor"), // Properties: &armiotsecurity.SensorProperties{ // ConnectivityTime: to.Ptr("2020-11-17T12:31:25Z"), // DynamicLearning: to.Ptr(true), // LearningMode: to.Ptr(true), // SensorStatus: to.Ptr(armiotsecurity.SensorStatusOk), // SensorType: to.Ptr(armiotsecurity.SensorTypeOt), // SensorVersion: to.Ptr("2020.11.01.1643"), // TiAutomaticUpdates: to.Ptr(true), // TiStatus: to.Ptr(armiotsecurity.TiStatusOk), // TiVersion: to.Ptr("2020-11-17T12:31:25Z"), // Zone: to.Ptr("Zone Name"), // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // }, // { // Name: to.Ptr("otherSensor"), // Type: to.Ptr("Microsoft.IoTSecurity/sensors"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sensors/otherSensor"), // Properties: &armiotsecurity.SensorProperties{ // ConnectivityTime: to.Ptr("2020-11-17T12:31:25Z"), // DynamicLearning: to.Ptr(false), // LearningMode: to.Ptr(false), // SensorStatus: to.Ptr(armiotsecurity.SensorStatusDisconnected), // SensorType: to.Ptr(armiotsecurity.SensorTypeOt), // SensorVersion: to.Ptr("2020.11.01.1643"), // TiAutomaticUpdates: to.Ptr(true), // TiStatus: to.Ptr(armiotsecurity.TiStatusOk), // TiVersion: to.Ptr("2020-11-17T12:31:25Z"), // Zone: to.Ptr("Zone Name"), // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // }}, // } }
Output:
func (*SensorsClient) TriggerTiPackageUpdate ¶
func (client *SensorsClient) TriggerTiPackageUpdate(ctx context.Context, scope string, sensorName string, options *SensorsClientTriggerTiPackageUpdateOptions) (SensorsClientTriggerTiPackageUpdateResponse, error)
TriggerTiPackageUpdate - Trigger threat intelligence package update If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- scope - Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)
- sensorName - Name of the IoT sensor
- options - SensorsClientTriggerTiPackageUpdateOptions contains the optional parameters for the SensorsClient.TriggerTiPackageUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Sensors/TriggerTiPackageUpdate.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewSensorsClient().TriggerTiPackageUpdate(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", "mySensor", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
type SensorsClientCreateOrUpdateOptions ¶ added in v0.2.0
type SensorsClientCreateOrUpdateOptions struct { }
SensorsClientCreateOrUpdateOptions contains the optional parameters for the SensorsClient.CreateOrUpdate method.
type SensorsClientCreateOrUpdateResponse ¶ added in v0.2.0
type SensorsClientCreateOrUpdateResponse struct { // IoT sensor model SensorModel }
SensorsClientCreateOrUpdateResponse contains the response from method SensorsClient.CreateOrUpdate.
type SensorsClientDeleteOptions ¶ added in v0.2.0
type SensorsClientDeleteOptions struct { }
SensorsClientDeleteOptions contains the optional parameters for the SensorsClient.Delete method.
type SensorsClientDeleteResponse ¶ added in v0.2.0
type SensorsClientDeleteResponse struct { }
SensorsClientDeleteResponse contains the response from method SensorsClient.Delete.
type SensorsClientDownloadActivationOptions ¶ added in v0.2.0
type SensorsClientDownloadActivationOptions struct { }
SensorsClientDownloadActivationOptions contains the optional parameters for the SensorsClient.DownloadActivation method.
type SensorsClientDownloadActivationResponse ¶ added in v0.2.0
type SensorsClientDownloadActivationResponse struct { // Body contains the streaming response. Body io.ReadCloser }
SensorsClientDownloadActivationResponse contains the response from method SensorsClient.DownloadActivation.
type SensorsClientDownloadResetPasswordOptions ¶ added in v0.2.0
type SensorsClientDownloadResetPasswordOptions struct { }
SensorsClientDownloadResetPasswordOptions contains the optional parameters for the SensorsClient.DownloadResetPassword method.
type SensorsClientDownloadResetPasswordResponse ¶ added in v0.2.0
type SensorsClientDownloadResetPasswordResponse struct { // Body contains the streaming response. Body io.ReadCloser }
SensorsClientDownloadResetPasswordResponse contains the response from method SensorsClient.DownloadResetPassword.
type SensorsClientGetOptions ¶ added in v0.2.0
type SensorsClientGetOptions struct { }
SensorsClientGetOptions contains the optional parameters for the SensorsClient.Get method.
type SensorsClientGetResponse ¶ added in v0.2.0
type SensorsClientGetResponse struct { // IoT sensor model SensorModel }
SensorsClientGetResponse contains the response from method SensorsClient.Get.
type SensorsClientListOptions ¶ added in v0.2.0
type SensorsClientListOptions struct { }
SensorsClientListOptions contains the optional parameters for the SensorsClient.List method.
type SensorsClientListResponse ¶ added in v0.2.0
type SensorsClientListResponse struct { // List of IoT sensors SensorsList }
SensorsClientListResponse contains the response from method SensorsClient.List.
type SensorsClientTriggerTiPackageUpdateOptions ¶ added in v0.2.0
type SensorsClientTriggerTiPackageUpdateOptions struct { }
SensorsClientTriggerTiPackageUpdateOptions contains the optional parameters for the SensorsClient.TriggerTiPackageUpdate method.
type SensorsClientTriggerTiPackageUpdateResponse ¶ added in v0.2.0
type SensorsClientTriggerTiPackageUpdateResponse struct { }
SensorsClientTriggerTiPackageUpdateResponse contains the response from method SensorsClient.TriggerTiPackageUpdate.
type SensorsList ¶
type SensorsList struct { // READ-ONLY; List data Value []*SensorModel }
SensorsList - List of IoT sensors
func (SensorsList) MarshalJSON ¶
func (s SensorsList) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SensorsList.
func (*SensorsList) UnmarshalJSON ¶ added in v0.6.0
func (s *SensorsList) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SensorsList.
type SiteModel ¶
type SiteModel struct { // IoT site properties Properties *SiteProperties // 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 }
SiteModel - IoT site model
func (SiteModel) MarshalJSON ¶ added in v0.6.0
MarshalJSON implements the json.Marshaller interface for type SiteModel.
func (*SiteModel) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type SiteModel.
type SiteProperties ¶
type SiteProperties struct { // REQUIRED; Display name of the IoT site DisplayName *string // Tags of the IoT site Tags map[string]*string }
SiteProperties - IoT site properties
func (SiteProperties) MarshalJSON ¶
func (s SiteProperties) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type SiteProperties.
func (*SiteProperties) UnmarshalJSON ¶ added in v0.6.0
func (s *SiteProperties) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type SiteProperties.
type SitesClient ¶
type SitesClient struct {
// contains filtered or unexported fields
}
SitesClient contains the methods for the Sites group. Don't use this type directly, use NewSitesClient() instead.
func NewSitesClient ¶
func NewSitesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SitesClient, error)
NewSitesClient creates a new instance of SitesClient with the specified values.
- credential - used to authorize requests. Usually a credential from azidentity.
- options - pass nil to accept the default values.
func (*SitesClient) CreateOrUpdate ¶
func (client *SitesClient) CreateOrUpdate(ctx context.Context, scope string, siteModel SiteModel, options *SitesClientCreateOrUpdateOptions) (SitesClientCreateOrUpdateResponse, error)
CreateOrUpdate - Create or update IoT site If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- scope - Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)
- siteModel - The IoT sites model
- options - SitesClientCreateOrUpdateOptions contains the optional parameters for the SitesClient.CreateOrUpdate method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Sites/Put.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/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSitesClient().CreateOrUpdate(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", armiotsecurity.SiteModel{ Properties: &armiotsecurity.SiteProperties{ DisplayName: to.Ptr("IoT site name"), Tags: map[string]*string{ "key1": to.Ptr("value1"), "key2": to.Ptr("value2"), }, }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.SiteModel = armiotsecurity.SiteModel{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.IoTSecurity/sites"), // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sites/default"), // Properties: &armiotsecurity.SiteProperties{ // DisplayName: to.Ptr("IoT site name"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // } }
Output:
func (*SitesClient) Delete ¶
func (client *SitesClient) Delete(ctx context.Context, scope string, options *SitesClientDeleteOptions) (SitesClientDeleteResponse, error)
Delete - Delete IoT site If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- scope - Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)
- options - SitesClientDeleteOptions contains the optional parameters for the SitesClient.Delete method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Sites/Delete.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } _, err = clientFactory.NewSitesClient().Delete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } }
Output:
func (*SitesClient) Get ¶
func (client *SitesClient) Get(ctx context.Context, scope string, options *SitesClientGetOptions) (SitesClientGetResponse, error)
Get - Get IoT site If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- scope - Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)
- options - SitesClientGetOptions contains the optional parameters for the SitesClient.Get method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Sites/Get.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSitesClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub", 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.SiteModel = armiotsecurity.SiteModel{ // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.IoTSecurity/sites"), // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sites/default"), // Properties: &armiotsecurity.SiteProperties{ // DisplayName: to.Ptr("IoT site name"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // } }
Output:
func (*SitesClient) List ¶
func (client *SitesClient) List(ctx context.Context, scope string, options *SitesClientListOptions) (SitesClientListResponse, error)
List - List IoT sites If the operation fails it returns an *azcore.ResponseError type.
Generated from API version 2021-02-01-preview
- scope - Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub)
- options - SitesClientListOptions contains the optional parameters for the SitesClient.List method.
Example ¶
Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f790e624d0d080b89d962a3bd19c65bc6a6b2f5e/specification/iotsecurity/resource-manager/Microsoft.IoTSecurity/preview/2021-02-01-preview/examples/Sites/List.json
package main import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotsecurity/armiotsecurity" ) func main() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() clientFactory, err := armiotsecurity.NewClientFactory("<subscription-id>", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := clientFactory.NewSitesClient().List(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/sites", 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.SitesList = armiotsecurity.SitesList{ // Value: []*armiotsecurity.SiteModel{ // { // Name: to.Ptr("default"), // Type: to.Ptr("Microsoft.IoTSecurity/sites"), // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/myHub/providers/Microsoft.IoTSecurity/sites/default"), // Properties: &armiotsecurity.SiteProperties{ // DisplayName: to.Ptr("IoT site name"), // Tags: map[string]*string{ // "key1": to.Ptr("value1"), // "key2": to.Ptr("value2"), // }, // }, // SystemData: &armiotsecurity.SystemData{ // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // CreatedBy: to.Ptr("string"), // CreatedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), // LastModifiedBy: to.Ptr("string"), // LastModifiedByType: to.Ptr(armiotsecurity.CreatedByTypeUser), // }, // }}, // } }
Output:
type SitesClientCreateOrUpdateOptions ¶ added in v0.2.0
type SitesClientCreateOrUpdateOptions struct { }
SitesClientCreateOrUpdateOptions contains the optional parameters for the SitesClient.CreateOrUpdate method.
type SitesClientCreateOrUpdateResponse ¶ added in v0.2.0
type SitesClientCreateOrUpdateResponse struct { // IoT site model SiteModel }
SitesClientCreateOrUpdateResponse contains the response from method SitesClient.CreateOrUpdate.
type SitesClientDeleteOptions ¶ added in v0.2.0
type SitesClientDeleteOptions struct { }
SitesClientDeleteOptions contains the optional parameters for the SitesClient.Delete method.
type SitesClientDeleteResponse ¶ added in v0.2.0
type SitesClientDeleteResponse struct { }
SitesClientDeleteResponse contains the response from method SitesClient.Delete.
type SitesClientGetOptions ¶ added in v0.2.0
type SitesClientGetOptions struct { }
SitesClientGetOptions contains the optional parameters for the SitesClient.Get method.
type SitesClientGetResponse ¶ added in v0.2.0
type SitesClientGetResponse struct { // IoT site model SiteModel }
SitesClientGetResponse contains the response from method SitesClient.Get.
type SitesClientListOptions ¶ added in v0.2.0
type SitesClientListOptions struct { }
SitesClientListOptions contains the optional parameters for the SitesClient.List method.
type SitesClientListResponse ¶ added in v0.2.0
type SitesClientListResponse struct { // List of IoT sites SitesList }
SitesClientListResponse contains the response from method SitesClient.List.
type SitesList ¶
type SitesList struct { // READ-ONLY; List data Value []*SiteModel }
SitesList - List of IoT sites
func (SitesList) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type SitesList.
func (*SitesList) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type SitesList.
type Slot ¶
type Slot struct { // A bag of fields which extends the slot information. AdditionalData any // Firmware revision of the slot. FirmwareVersion *string // Hardware revision of the slot. HardwareRevision *string // Hardware vendor of the slot. HardwareVendor *string // Model of the slot. Model *string // Module version of the slot. ModuleVersion *string // Product code of the slot. ProductCode *string // Serial number of the slot. SerialNumber *string // Slot type. SlotType *SlotType // READ-ONLY; List of Common Platform Enumeration (CPE) of the slot Cpes []*string // READ-ONLY; Rack number in the backplane RackNumber *int32 // READ-ONLY; Slot number inside the rack SlotNumber *int32 }
Slot data in PLC backplane
func (Slot) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface for type Slot.
func (*Slot) UnmarshalJSON ¶ added in v0.6.0
UnmarshalJSON implements the json.Unmarshaller interface for type Slot.
type SlotType ¶
type SlotType string
SlotType - Slot type.
func PossibleSlotTypeValues ¶
func PossibleSlotTypeValues() []SlotType
PossibleSlotTypeValues returns the possible values for the SlotType 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 TiStatus ¶
type TiStatus string
TiStatus - TI Status of the IoT sensor
func PossibleTiStatusValues ¶
func PossibleTiStatusValues() []TiStatus
PossibleTiStatusValues returns the possible values for the TiStatus const type.
type UpgradePackageDownloadInfo ¶
type UpgradePackageDownloadInfo struct { // READ-ONLY; Minimum base version for upgrade FromVersion *string // READ-ONLY; Download link Link *string // READ-ONLY; Version number Version *string // READ-ONLY; Kind of the version VersionKind *VersionKind }
UpgradePackageDownloadInfo - Information on a specific package upgrade download
func (UpgradePackageDownloadInfo) MarshalJSON ¶ added in v0.6.0
func (u UpgradePackageDownloadInfo) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaller interface for type UpgradePackageDownloadInfo.
func (*UpgradePackageDownloadInfo) UnmarshalJSON ¶ added in v0.6.0
func (u *UpgradePackageDownloadInfo) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaller interface for type UpgradePackageDownloadInfo.
type VersionKind ¶
type VersionKind string
VersionKind - Kind of the version
const ( VersionKindLatest VersionKind = "Latest" VersionKindPreview VersionKind = "Preview" VersionKindPrevious VersionKind = "Previous" )
func PossibleVersionKindValues ¶
func PossibleVersionKindValues() []VersionKind
PossibleVersionKindValues returns the possible values for the VersionKind const type.