Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.2.0-beta.4</Version>
<!--The ApiCompatVersion is managed automatically and should not generally be modified manually.-->
<ApiCompatVersion>1.1.1</ApiCompatVersion>
<PackageId>Azure.ResourceManager.Grafana</PackageId>
<Description>Azure Resource Manager client SDK for Azure resource provider Grafana.</Description>
<PackageTags>azure;management;arm;resource manager;grafana</PackageTags>
<IncludeAutorestDependency>true</IncludeAutorestDependency>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using Azure.Core;
using Azure.ResourceManager.Models;

namespace Azure.ResourceManager.Grafana.Models
{
Expand Down Expand Up @@ -33,5 +36,45 @@ public static ManagedGrafanaProperties ManagedGrafanaProperties(GrafanaProvision
{
throw new NotSupportedException("This method is obsolete and will be removed in a future release.");
}

/// <summary> Available plugins of grafana. </summary>
/// <param name="pluginId"> Grafana plugin id. </param>
/// <param name="name"> Grafana plugin display name. </param>
/// <returns> A new <see cref="Models.GrafanaAvailablePlugin"/> instance for mocking. </returns>
public static GrafanaAvailablePlugin GrafanaAvailablePlugin(string pluginId, string name)
{
return GrafanaAvailablePlugin(pluginId, name, null, null);
}

/// <param name="id"> Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. </param>
/// <param name="name"> The name of the resource. </param>
/// <param name="resourceType"> The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". </param>
/// <param name="privateEndpointId"> The resource identifier of the private endpoint. </param>
/// <param name="systemData"> Azure Resource Manager metadata containing createdBy and modifiedBy information. </param>
/// <param name="connectionState"> A collection of information about the state of the connection between service consumer and provider. </param>
/// <param name="groupIds"> The private endpoint connection group ids. </param>
/// <param name="provisioningState"> The provisioning state of the private endpoint connection resource. </param>
/// <returns> A new <see cref="Grafana.GrafanaPrivateEndpointConnectionData"/> instance for mocking. </returns>
public static GrafanaPrivateEndpointConnectionData GrafanaPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier privateEndpointId, GrafanaPrivateLinkServiceConnectionState connectionState = default, IEnumerable<string> groupIds = default, GrafanaPrivateEndpointConnectionProvisioningState? provisioningState = default)
{
return GrafanaPrivateEndpointConnectionData(id, name, resourceType, systemData, connectionState, groupIds, provisioningState, privateEndpointId);
}

/// <summary> The grafana resource type. </summary>
/// <param name="id"> Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. </param>
/// <param name="name"> The name of the resource. </param>
/// <param name="resourceType"> The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". </param>
/// <param name="systemData"> Azure Resource Manager metadata containing createdBy and modifiedBy information. </param>
/// <param name="tags"> Resource tags. </param>
/// <param name="location"> The geo-location where the resource lives. </param>
/// <param name="properties"> Properties specific to the grafana resource. </param>
/// <param name="skuName"> The Sku name of the grafana resource. </param>
/// <param name="identity"> The managed service identities assigned to this resource. </param>
/// <returns> A new <see cref="Grafana.ManagedGrafanaData"/> instance for mocking. </returns>
public static ManagedGrafanaData ManagedGrafanaData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary<string, string> tags, AzureLocation location = default, string skuName = default, ManagedGrafanaProperties properties = default, ManagedServiceIdentity identity = default)
{
ManagedGrafanaSku sku = new ManagedGrafanaSku(skuName);
return ManagedGrafanaData(id, name, resourceType, systemData, location, properties, sku, tags, identity);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager.Grafana.Models;

namespace Azure.ResourceManager.Grafana
{
internal partial class ManagedGrafanasFetchAvailablePluginsAsyncCollectionResultOfT : AsyncPageable<GrafanaAvailablePlugin>
{
private readonly ManagedGrafanas _client;
private readonly string _subscriptionId;
private readonly string _resourceGroupName;
private readonly string _workspaceName;
private readonly RequestContext _context;

/// <summary> Initializes a new instance of ManagedGrafanasFetchAvailablePluginsAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. </summary>
/// <param name="client"> The ManagedGrafanas client used to send requests. </param>
/// <param name="subscriptionId"> The ID of the target subscription. The value must be an UUID. </param>
/// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
/// <param name="workspaceName"> The workspace name of Azure Managed Grafana. </param>
/// <param name="context"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
public ManagedGrafanasFetchAvailablePluginsAsyncCollectionResultOfT(ManagedGrafanas client, string subscriptionId, string resourceGroupName, string workspaceName, RequestContext context) : base(context?.CancellationToken ?? default)
{
_client = client;
_subscriptionId = subscriptionId;
_resourceGroupName = resourceGroupName;
_workspaceName = workspaceName;
_context = context;
}

/// <summary> Gets the pages of ManagedGrafanasFetchAvailablePluginsAsyncCollectionResultOfT as an enumerable collection. </summary>
/// <param name="continuationToken"> A continuation token indicating where to resume paging. </param>
/// <param name="pageSizeHint"> The number of items per page. </param>
/// <returns> The pages of ManagedGrafanasFetchAvailablePluginsAsyncCollectionResultOfT as an enumerable collection. </returns>
public override async IAsyncEnumerable<Page<GrafanaAvailablePlugin>> AsPages(string continuationToken, int? pageSizeHint)
{
Response response = await GetNextResponseAsync(pageSizeHint, null).ConfigureAwait(false);
GrafanaAvailablePluginListResult result = GrafanaAvailablePluginListResult.FromResponse(response);
yield return Page<GrafanaAvailablePlugin>.FromValues((IReadOnlyList<GrafanaAvailablePlugin>)result.Value, null, response);
}

/// <summary> Get next page. </summary>
/// <param name="pageSizeHint"> The number of items per page. </param>
/// <param name="continuationToken"> A continuation token indicating where to resume paging. </param>
private async ValueTask<Response> GetNextResponseAsync(int? pageSizeHint, string continuationToken)
{
HttpMessage message = _client.CreateFetchAvailablePluginsRequest(_subscriptionId, _resourceGroupName, _workspaceName, _context);
using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("ManagedGrafanaResource.FetchAvailablePlugins");
scope.Start();
try
{
return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System;
using System.Collections.Generic;
using Azure;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager.Grafana.Models;

namespace Azure.ResourceManager.Grafana
{
internal partial class ManagedGrafanasFetchAvailablePluginsCollectionResultOfT : Pageable<GrafanaAvailablePlugin>
{
private readonly ManagedGrafanas _client;
private readonly string _subscriptionId;
private readonly string _resourceGroupName;
private readonly string _workspaceName;
private readonly RequestContext _context;

/// <summary> Initializes a new instance of ManagedGrafanasFetchAvailablePluginsCollectionResultOfT, which is used to iterate over the pages of a collection. </summary>
/// <param name="client"> The ManagedGrafanas client used to send requests. </param>
/// <param name="subscriptionId"> The ID of the target subscription. The value must be an UUID. </param>
/// <param name="resourceGroupName"> The name of the resource group. The name is case insensitive. </param>
/// <param name="workspaceName"> The workspace name of Azure Managed Grafana. </param>
/// <param name="context"> The request options, which can override default behaviors of the client pipeline on a per-call basis. </param>
public ManagedGrafanasFetchAvailablePluginsCollectionResultOfT(ManagedGrafanas client, string subscriptionId, string resourceGroupName, string workspaceName, RequestContext context) : base(context?.CancellationToken ?? default)
{
_client = client;
_subscriptionId = subscriptionId;
_resourceGroupName = resourceGroupName;
_workspaceName = workspaceName;
_context = context;
}

/// <summary> Gets the pages of ManagedGrafanasFetchAvailablePluginsCollectionResultOfT as an enumerable collection. </summary>
/// <param name="continuationToken"> A continuation token indicating where to resume paging. </param>
/// <param name="pageSizeHint"> The number of items per page. </param>
/// <returns> The pages of ManagedGrafanasFetchAvailablePluginsCollectionResultOfT as an enumerable collection. </returns>
public override IEnumerable<Page<GrafanaAvailablePlugin>> AsPages(string continuationToken, int? pageSizeHint)
{
Response response = GetNextResponse(pageSizeHint, null);
GrafanaAvailablePluginListResult result = GrafanaAvailablePluginListResult.FromResponse(response);
yield return Page<GrafanaAvailablePlugin>.FromValues((IReadOnlyList<GrafanaAvailablePlugin>)result.Value, null, response);
}

/// <summary> Get next page. </summary>
/// <param name="pageSizeHint"> The number of items per page. </param>
/// <param name="continuationToken"> A continuation token indicating where to resume paging. </param>
private Response GetNextResponse(int? pageSizeHint, string continuationToken)
{
HttpMessage message = _client.CreateFetchAvailablePluginsRequest(_subscriptionId, _resourceGroupName, _workspaceName, _context);
using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("ManagedGrafanaResource.FetchAvailablePlugins");
scope.Start();
try
{
return _client.Pipeline.ProcessMessage(message, _context);
}
catch (Exception e)
{
scope.Failed(e);
throw;
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System.ComponentModel;
using Azure.ResourceManager.Grafana.Models;

namespace Azure.ResourceManager.Grafana
{
public partial class ManagedGrafanaData
{
/// <summary> The Sku name of the grafana resource. </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public string SkuName
{
get => Sku?.Name;
set
{
if (Sku == null)
{
Sku = new ManagedGrafanaSku(value);
}
else
{
Sku.Name = value;
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System.Collections.Generic;
using System.ComponentModel;
using System.Threading;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Core.Pipeline;
using Azure.ResourceManager.Grafana.Models;

namespace Azure.ResourceManager.Grafana
{
public partial class ManagedGrafanaResource
{
/// <summary>
/// A synchronous resource action.
/// <list type="bullet">
/// <item>
/// <term> Request Path. </term>
/// <description> /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/fetchAvailablePlugins. </description>
/// </item>
/// <item>
/// <term> Operation Id. </term>
/// <description> ManagedGrafanas_FetchAvailablePlugins. </description>
/// </item>
/// <item>
/// <term> Default Api Version. </term>
/// <description> 2025-09-01-preview. </description>
/// </item>
/// <item>
/// <term> Resource. </term>
/// <description> <see cref="ManagedGrafanaResource"/>. </description>
/// </item>
/// </list>
/// </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <returns> A collection of <see cref="GrafanaAvailablePlugin"/> that may take multiple service requests to iterate over. </returns>
public virtual AsyncPageable<GrafanaAvailablePlugin> FetchAvailablePluginsAsync(CancellationToken cancellationToken = default)
{
RequestContext context = new RequestContext
{
CancellationToken = cancellationToken
};
return new ManagedGrafanasFetchAvailablePluginsAsyncCollectionResultOfT(_managedGrafanasRestClient, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, context);
}

/// <summary>
/// A synchronous resource action.
/// <list type="bullet">
/// <item>
/// <term> Request Path. </term>
/// <description> /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Dashboard/grafana/{workspaceName}/fetchAvailablePlugins. </description>
/// </item>
/// <item>
/// <term> Operation Id. </term>
/// <description> ManagedGrafanas_FetchAvailablePlugins. </description>
/// </item>
/// <item>
/// <term> Default Api Version. </term>
/// <description> 2025-09-01-preview. </description>
/// </item>
/// <item>
/// <term> Resource. </term>
/// <description> <see cref="ManagedGrafanaResource"/>. </description>
/// </item>
/// </list>
/// </summary>
/// <param name="cancellationToken"> The cancellation token to use. </param>
/// <returns> A collection of <see cref="GrafanaAvailablePlugin"/> that may take multiple service requests to iterate over. </returns>
public virtual Pageable<GrafanaAvailablePlugin> FetchAvailablePlugins(CancellationToken cancellationToken = default)
{
RequestContext context = new RequestContext
{
CancellationToken = cancellationToken
};
return new ManagedGrafanasFetchAvailablePluginsCollectionResultOfT(_managedGrafanasRestClient, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, context);
}

/// <summary>
/// Update a workspace for Grafana resource.
/// </summary>
/// <param name="patch"> The parameters to update the Grafana resource. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual Response<ManagedGrafanaResource> Update(ManagedGrafanaPatch patch, CancellationToken cancellationToken = default)
{
return Update(WaitUntil.Completed, patch, cancellationToken).WaitForCompletion(cancellationToken);
}

/// <summary>
/// Update a workspace for Grafana resource.
/// </summary>
/// <param name="patch"> The parameters to update the Grafana resource. </param>
/// <param name="cancellationToken"> The cancellation token to use. </param>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual async Task<Response<ManagedGrafanaResource>> UpdateAsync(ManagedGrafanaPatch patch, CancellationToken cancellationToken = default)
{
var operation = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken).ConfigureAwait(false);
return await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#nullable disable

using System.ComponentModel;

namespace Azure.ResourceManager.Grafana.Models
{
public partial class ManagedGrafanaPatch
{
/// <summary> The Sku name of the grafana resource. </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public string SkuName
{
get => Sku?.Name;
set
{
if (Sku == null)
{
Sku = new ManagedGrafanaSku(value);
}
else
{
Sku.Name = value;
}
}
}
}
}
Loading