Skip to content

initial TSP conversion of Microsoft.AnalysisServices #26882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/rest";
import "./models.tsp";

using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;

namespace Microsoft.AnalysisServices;
@doc("Represents an instance of an Analysis Services resource.")
model AnalysisServicesServer
is TrackedResource<AnalysisServicesServerProperties> {
@doc("The name of the Analysis Services server. It must be a minimum of 3 characters, and a maximum of 63.")
@maxLength(63)
@minLength(3)
@pattern("^[a-z][a-z0-9]*$")
@path
@key("serverName")
@segment("servers")
name: string;
}

@armResourceOperations
interface AnalysisServicesServers {
@doc("Gets details about the specified Analysis Services server.")
getDetails is ArmResourceRead<AnalysisServicesServer>;
@doc("Provisions the specified Analysis Services server based on the configuration specified in the request.")
create is ArmResourceCreateOrUpdateAsync<AnalysisServicesServer>;
@doc("Updates the current state of the specified Analysis Services server.")
update is ArmResourcePatchAsync<
AnalysisServicesServer,
AnalysisServicesServerProperties
>;
@doc("Deletes the specified Analysis Services server.")
delete is ArmResourceDeleteAsync<AnalysisServicesServer>;
@doc("Gets all the Analysis Services servers for the given resource group.")
listByResourceGroup is ArmResourceListByParent<AnalysisServicesServer>;
// @doc("Lists all the Analysis Services servers for the given subscription.")
// list is ArmListBySubscription<AnalysisServicesServer>;
// @doc("Lists eligible SKUs for Analysis Services resource provider.")
// listSkusForNew is ArmListBySubscription<AnalysisServicesServer>;
@doc("Suspends operation of the specified Analysis Services server instance.")
suspend is ArmResourceActionAsync<AnalysisServicesServer, {}, {}>;
@doc("Resumes operation of the specified Analysis Services server instance.")
resume is ArmResourceActionAsync<AnalysisServicesServer, {}, {}>;
@doc("Return the gateway status of the specified Analysis Services server instance.")
listGatewayStatus is ArmResourceActionSync<
AnalysisServicesServer,
{},
GatewayListStatusLive
>;
@doc("Dissociates a Unified Gateway associated with the server.")
dissociateGateway is ArmResourceActionSync<AnalysisServicesServer, {}, {}>;
@doc("Lists eligible SKUs for an Analysis Services resource.")
@route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/skus")
@get
ListSkusForExisting is Azure.Core.Foundations.Operation<
{
@doc("The name of the Azure Resource group of which a given Analysis Services server is part. This name must be at least 1 character in length, and no more than 90.")
@maxLength(90)
@minLength(1)
@pattern("^[-\\w\\._\\(\\)]+$")
@path
resourceGroupName: string;

@doc("The name of the Analysis Services server. It must be at least 3 characters in length, and no more than 63.")
@maxLength(63)
@minLength(3)
@pattern("^[a-z][a-z0-9]*$")
@path
serverName: string;

@doc("A unique identifier for a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.")
@path
subscriptionId: string;
},
SkuEnumerationForExistingResourceResult
>;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "./models.tsp";
import "./AnalysisServicesServer.tsp";

using TypeSpec.Rest;
using TypeSpec.Http;
using Azure.ResourceManager.Foundations;
using Azure.Core;
using Azure.ResourceManager;
using TypeSpec.Versioning;
@armProviderNamespace
@service({
title: "AzureAnalysisServices",
})
@versioned(Versions)
@doc("The Azure Analysis Services Web API provides a RESTful set of web services that enables users to create, retrieve, update, and delete Analysis Services servers")
namespace Microsoft.AnalysisServices;

@doc("The available API versions.")
enum Versions {
@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
@useDependency(Azure.Core.Versions.v1_0_Preview_1)
v2017_08_01: "2017-08-01",
}
218 changes: 218 additions & 0 deletions specification/analysisservices/Analysisservices.Management/models.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
import "@typespec/rest";
import "@typespec/http";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";


using TypeSpec.Rest;
using TypeSpec.Http;
using Azure.ResourceManager;


namespace Microsoft.AnalysisServices;

interface Operations extends Azure.ResourceManager.Operations {}


enum State {
"Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling"
}

enum ProvisioningState {
"Deleting", "Succeeded", "Failed", "Paused", "Suspended", "Provisioning", "Updating", "Suspending", "Pausing", "Resuming", "Preparing", "Scaling"
}

enum SkuTier {
"Development", "Basic", "Standard"
}
@Azure.Core.fixed
enum ConnectionMode {
"All", "ReadOnly"
}
// @Azure.Core.fixed
// enum ManagedMode {
// 0: 0, 1: 1
// }
// @Azure.Core.fixed
// enum ServerMonitorMode {
// 0: 0, 1: 1
// }



@doc("Properties of Analysis Services resource.")
model AnalysisServicesServerProperties {
// ...AnalysisServicesServerMutableProperties;
@doc("The current state of Analysis Services resource. The state is to indicate more states outside of resource provisioning.")
@visibility("read")
"state"?: State;
@doc("The current deployment state of Analysis Services resource. The provisioningState is to indicate states for resource provisioning.")
@visibility("read")
"provisioningState"?: ProvisioningState;
@doc("The full name of the Analysis Services resource.")
@visibility("read")
"serverFullName"?: string;
@doc("The SKU of the Analysis Services resource.")
"sku"?: ResourceSku;
}

@doc("An array of administrator user identities.")
model ServerAdministrators {
@doc("An array of administrator user identities.")
"members"?: string[];
}

@doc("The gateway details.")
model GatewayDetails {
@doc("Gateway resource to be associated with the server.")
"gatewayResourceId"?: string;
@doc("Gateway object id from in the DMTS cluster for the gateway resource.")
@visibility("read")
"gatewayObjectId"?: string;
@doc("Uri of the DMTS cluster.")
@visibility("read")
"dmtsClusterUri"?: string;
}

@doc("An array of firewall rules.")
model IPv4FirewallSettings {
@doc("An array of firewall rules.")
"firewallRules"?: IPv4FirewallRule[];
@doc("The indicator of enabling PBI service.")
"enablePowerBIService"?: boolean;
}

@doc("The detail of firewall rule.")
model IPv4FirewallRule {
@doc("The rule name.")
"firewallRuleName"?: string;
@doc("The start range of IPv4.")
"rangeStart"?: string;
@doc("The end range of IPv4.")
"rangeEnd"?: string;
}

@doc("An object that represents enumerating SKUs for existing resources.")
model SkuEnumerationForExistingResourceResult {
@doc("The collection of available SKUs for existing resources.")
"value"?: SkuDetailsForExistingResource[];
}

@doc("An object that represents SKU details for existing resources.")
model SkuDetailsForExistingResource {
@doc("The SKU in SKU details for existing resources.")
"sku"?: ResourceSku;
@doc("The resource type.")
"resourceType"?: string;
}

@doc("Status of gateway is live.")
model GatewayListStatusLive {
@doc("Live message of list gateway. Status: 0 - Live")
"status"?: 0;
}

@doc("Status of gateway is error.")
@error
model GatewayListStatusError {
// @doc("Error of the list gateway status.")
// "error"?: ErrorDetail;
}

@doc("Details of server name request body.")
model CheckServerNameAvailabilityParameters {
@doc("Name for checking availability.")
@maxLength(63)
@minLength(3)
@pattern("^[a-z][a-z0-9]*$")
"name"?: string;
@doc("The resource type of azure analysis services.")
"type"?: string;
}

@doc("The checking result of server name availability.")
model CheckServerNameAvailabilityResult {
@doc("Indicator of available of the server name.")
"nameAvailable"?: boolean;
@doc("The reason of unavailability.")
"reason"?: string;
@doc("The detailed message of the request unavailability.")
"message"?: string;
}

@doc("The status of operation.")
model OperationStatus {
@doc("The operation Id.")
"id"?: string;
@doc("The operation name.")
"name"?: string;
@doc("The start time of the operation.")
"startTime"?: string;
@doc("The end time of the operation.")
"endTime"?: string;
@doc("The status of the operation.")
"status"?: string;
// @doc("The error detail of the operation if any.")
// "error"?: ErrorDetail;
}

@doc("Additional properties to expose performance metrics to shoebox.")
model OperationProperties {
@doc("Performance metrics to shoebox.")
"serviceSpecification"?: OperationPropertiesServiceSpecification;
}

@doc("Performance metrics to shoebox.")
model OperationPropertiesServiceSpecification {
@doc("The metric specifications.")
@visibility("read")
"metricSpecifications"?: MetricSpecifications[];
@doc("The log specifications.")
@visibility("read")
"logSpecifications"?: LogSpecifications[];
}

@doc("Available operation metric specification for exposing performance metrics to shoebox.")
model MetricSpecifications {
@doc("The name of metric.")
@visibility("read")
"name"?: string;
@doc("The displayed name of metric.")
@visibility("read")
"displayName"?: string;
@doc("The displayed description of metric.")
@visibility("read")
"displayDescription"?: string;
@doc("The unit of the metric.")
@visibility("read")
"unit"?: string;
@doc("The aggregation type of metric.")
@visibility("read")
"aggregationType"?: string;
@doc("The dimensions of metric.")
@visibility("read")
"dimensions"?: MetricDimensions[];
}

@doc("Metric dimension.")
model MetricDimensions {
@doc("Dimension name.")
@visibility("read")
"name"?: string;
@doc("Dimension display name.")
@visibility("read")
"displayName"?: string;
}

@doc("The log metric specification for exposing performance metrics to shoebox.")
model LogSpecifications {
@doc("The name of metric.")
@visibility("read")
"name"?: string;
@doc("The displayed name of log.")
@visibility("read")
"displayName"?: string;
@doc("The blob duration for the log.")
@visibility("read")
"blobDuration"?: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "Resources":{ "AnalysisServicesServer":{ "Name":"AnalysisServicesServer","GetOperations":[{ "Name":"Get","Path":"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}","Method":"GET","OperationID":"Servers_GetDetails","IsLongRunning":false,"PagingMetadata":null,"Description":"Gets details about the specified Analysis Services server."}],"CreateOperations":[{ "Name":"CreateOrUpdate","Path":"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}","Method":"PUT","OperationID":"Servers_Create","IsLongRunning":true,"PagingMetadata":null,"Description":"Provisions the specified Analysis Services server based on the configuration specified in the request."}],"UpdateOperations":[{ "Name":"Update","Path":"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}","Method":"PATCH","OperationID":"Servers_Update","IsLongRunning":true,"PagingMetadata":null,"Description":"Updates the current state of the specified Analysis Services server."}],"DeleteOperations":[{ "Name":"Delete","Path":"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}","Method":"DELETE","OperationID":"Servers_Delete","IsLongRunning":true,"PagingMetadata":null,"Description":"Deletes the specified Analysis Services server."}],"ListOperations":[{ "Name":"GetAll","Path":"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers","Method":"GET","OperationID":"Servers_ListByResourceGroup","IsLongRunning":false,"PagingMetadata":{ "Method":"ListByResourceGroup","NextPageMethod":null,"ItemName":"value","NextLinkName":null},"Description":"Gets all the Analysis Services servers for the given resource group."}],"OperationsFromResourceGroupExtension":[],"OperationsFromSubscriptionExtension":[{ "Name":"GetAnalysisServicesServers","Path":"/subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/servers","Method":"GET","OperationID":"Servers_List","IsLongRunning":false,"PagingMetadata":{ "Method":"List","NextPageMethod":null,"ItemName":"value","NextLinkName":null},"Description":"Lists all the Analysis Services servers for the given subscription."},{ "Name":"GetSkusForNewServers","Path":"/subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/skus","Method":"GET","OperationID":"Servers_ListSkusForNew","IsLongRunning":false,"PagingMetadata":{ "Method":"ListSkusForNew","NextPageMethod":null,"ItemName":"value","NextLinkName":null},"Description":"Lists eligible SKUs for Analysis Services resource provider."},{ "Name":"CheckNameAvailabilityServer","Path":"/subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/locations/{location}/checkNameAvailability","Method":"POST","OperationID":"Servers_CheckNameAvailability","IsLongRunning":false,"PagingMetadata":null,"Description":"Check the name availability in the target location."},{ "Name":"GetOperationResultsServer","Path":"/subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/locations/{location}/operationresults/{operationId}","Method":"GET","OperationID":"Servers_ListOperationResults","IsLongRunning":false,"PagingMetadata":null,"Description":"List the result of the specified operation."},{ "Name":"GetOperationStatusesServer","Path":"/subscriptions/{subscriptionId}/providers/Microsoft.AnalysisServices/locations/{location}/operationstatuses/{operationId}","Method":"GET","OperationID":"Servers_ListOperationStatuses","IsLongRunning":false,"PagingMetadata":null,"Description":"List the status of operation."}],"OperationsFromManagementGroupExtension":[],"OperationsFromTenantExtension":[],"OtherOperations":[{ "Name":"Suspend","Path":"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/suspend","Method":"POST","OperationID":"Servers_Suspend","IsLongRunning":true,"PagingMetadata":null,"Description":"Suspends operation of the specified Analysis Services server instance."},{ "Name":"Resume","Path":"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/resume","Method":"POST","OperationID":"Servers_Resume","IsLongRunning":true,"PagingMetadata":null,"Description":"Resumes operation of the specified Analysis Services server instance."},{ "Name":"GetSkusForExisting","Path":"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/skus","Method":"GET","OperationID":"Servers_ListSkusForExisting","IsLongRunning":false,"PagingMetadata":{ "Method":"ListSkusForExisting","NextPageMethod":null,"ItemName":"value","NextLinkName":null},"Description":"Lists eligible SKUs for an Analysis Services resource."},{ "Name":"GetGatewayStatus","Path":"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/listGatewayStatus","Method":"POST","OperationID":"Servers_ListGatewayStatus","IsLongRunning":false,"PagingMetadata":null,"Description":"Return the gateway status of the specified Analysis Services server instance."},{ "Name":"DissociateGateway","Path":"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}/dissociateGateway","Method":"POST","OperationID":"Servers_DissociateGateway","IsLongRunning":false,"PagingMetadata":null,"Description":"Dissociates a Unified Gateway associated with the server."}],"Parents":["ResourceGroupResource"],"SwaggerModelName":"AnalysisServicesServer","ResourceType":"Microsoft.AnalysisServices/servers","ResourceKey":"serverName","ResourceKeySegment":"servers","IsTrackedResource":true,"IsTenantResource":false,"IsSubscriptionResource":false,"IsManagementGroupResource":false,"IsExtensionResource":false,"IsSingletonResource":false} } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
emit:
- "@azure-tools/typespec-autorest"
options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/analysisservices.json"
examples-directory: "{project-root}/examples"
linter:
extends:
- "@azure-tools/typespec-azure-resource-manager/all"
Loading