mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-27 08:29:33 -05:00
bd63aa3c6b
sed -i '1i/*\nCopyright (c) Edgeless Systems GmbH\n\nSPDX-License-Identifier: AGPL-3.0-only\n*/\n' `grep -rL --include='*.go' 'DO NOT EDIT'` gofumpt -w .
35 lines
793 B
Go
35 lines
793 B
Go
/*
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
package client
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
|
|
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights"
|
|
)
|
|
|
|
func (c *Client) CreateApplicationInsight(ctx context.Context) error {
|
|
properties := armapplicationinsights.Component{
|
|
Kind: to.Ptr("web"),
|
|
Location: to.Ptr(c.location),
|
|
Properties: &armapplicationinsights.ComponentProperties{
|
|
ApplicationType: to.Ptr(armapplicationinsights.ApplicationTypeWeb),
|
|
},
|
|
Tags: map[string]*string{"uid": to.Ptr(c.uid)},
|
|
}
|
|
|
|
_, err := c.applicationInsightsAPI.CreateOrUpdate(
|
|
ctx,
|
|
c.resourceGroup,
|
|
"constellation-insights-"+c.uid,
|
|
properties,
|
|
nil,
|
|
)
|
|
return err
|
|
}
|