1- import "@azure-tools/typespec-azure-core" ;
2- import "@azure-tools/typespec-azure-resource-manager" ;
31import "@azure-tools/typespec-client-generator-core" ;
4- import "@typespec/openapi" ;
5- import "@typespec/rest" ;
6- import "./common.tsp" ;
72
83using TypeSpec .Http ;
94using TypeSpec .OpenAPI ;
105using TypeSpec .Rest ;
116using Azure .ResourceManager ;
12- using Azure .ResourceManager .Foundations ;
137using Azure .ResourceManager .Private ;
148using Azure .ClientGenerator .Core ;
159
1610namespace Microsoft .DocumentDB ;
17- @ doc ( " Represents a mongo cluster resource." )
11+ /** Represents a mongo cluster resource. */
1812model MongoCluster is TrackedResource <MongoClusterProperties > {
19- @ doc ( " The name of the mongo cluster." )
13+ /** The name of the mongo cluster. */
2014 @ maxLength (40 )
2115 @ minLength (3 )
2216 @ pattern ("^[a-z0-9]+(-[a-z0-9]+)*" )
@@ -29,184 +23,184 @@ model MongoCluster is TrackedResource<MongoClusterProperties> {
2923
3024@ armResourceOperations
3125interface MongoClusters {
32- @ doc ( " Gets information about a mongo cluster." )
26+ /** Gets information about a mongo cluster. */
3327 get is ArmResourceRead <MongoCluster >;
34- @ doc ( " Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH." )
28+ /** Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH. */
3529 createOrUpdate is ArmResourceCreateOrUpdateAsync <MongoCluster >;
36- @ doc ( " Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition." )
30+ /** Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition. */
3731 update is ArmResourcePatchAsync <MongoCluster , MongoClusterProperties >;
38- @ doc ( " Deletes a mongo cluster." )
32+ /** Deletes a mongo cluster. */
3933 delete is ArmResourceDeleteWithoutOkAsync <MongoCluster >;
40- @ doc ( " List all the mongo clusters in a given resource group." )
34+ /** List all the mongo clusters in a given resource group. */
4135 listByResourceGroup is ArmResourceListByParent <MongoCluster >;
42- @ doc ( " List all the mongo clusters in a given subscription." )
36+ /** List all the mongo clusters in a given subscription. */
4337 list is ArmListBySubscription <MongoCluster >;
44- @ doc ( " List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well as other connection strings supported by the cluster." )
38+ /** List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well as other connection strings supported by the cluster. */
4539 listConnectionStrings is ArmResourceActionSync <
4640 MongoCluster ,
4741 void ,
4842 ListConnectionStringsResult
4943 >;
50- @ doc ( " Check if mongo cluster name is available for use." )
44+ /** Check if mongo cluster name is available for use. */
5145 @ action ("checkMongoClusterNameAvailability" )
5246 checkNameAvailability is checkLocalNameAvailability ;
5347}
5448
55- @ doc ( " The properties of a mongo cluster." )
49+ /** The properties of a mongo cluster. */
5650model MongoClusterProperties {
57- @ doc ( " The mode to create a mongo cluster." )
51+ /** The mode to create a mongo cluster. */
5852 @ visibility ("create" )
5953 createMode ? : CreateMode ;
6054
61- @ doc ( " The parameters to create a point-in-time restore mongo cluster." )
55+ /** The parameters to create a point-in-time restore mongo cluster. */
6256 @ visibility ("create" )
6357 restoreParameters ? : MongoClusterRestoreParameters ;
6458
65- @ doc ( " The administrator's login for the mongo cluster." )
59+ /** The administrator's login for the mongo cluster. */
6660 @ visibility ("read" , "create" , "update" )
6761 administratorLogin ? : string ;
6862
69- @ doc ( " The password of the administrator login." )
63+ /** The password of the administrator login. */
7064 @ visibility ("create" , "update" )
7165 @ secret
7266 administratorLoginPassword ? : string ;
7367
74- @ doc ( " The Mongo DB server version. Defaults to the latest available version if not specified." )
68+ /** The Mongo DB server version. Defaults to the latest available version if not specified. */
7569 serverVersion ? : string ;
7670
77- @ doc ( " The default mongo connection string for the cluster." )
71+ /** The default mongo connection string for the cluster. */
7872 @ visibility ("read" )
7973 connectionString ? : string ;
8074
81- @ doc ( " Earliest restore timestamp in UTC ISO8601 format." )
75+ /** Earliest restore timestamp in UTC ISO8601 format. */
8276 @ visibility ("read" )
8377 earliestRestoreTime ? : string ;
8478
85- @ doc ( " The provisioning state of the mongo cluster." )
79+ /** The provisioning state of the mongo cluster. */
8680 @ visibility ("read" )
8781 provisioningState ? : ProvisioningState ;
8882
89- @ doc ( " The status of the mongo cluster." )
83+ /** The status of the mongo cluster. */
9084 @ visibility ("read" )
9185 clusterStatus ? : MongoClusterStatus ;
9286
93- @ doc ( " Whether or not public endpoint access is allowed for this mongo cluster." )
87+ /** Whether or not public endpoint access is allowed for this mongo cluster. */
9488 publicNetworkAccess ? : PublicNetworkAccess ;
9589
96- @ doc ( " The list of node group specs in the cluster." )
90+ /** The list of node group specs in the cluster. */
9791 @ extension ("x-ms-identifiers" , [])
9892 nodeGroupSpecs ? : NodeGroupSpec [];
9993
100- @ doc ( " List of private endpoint connections." )
94+ /** List of private endpoint connections. */
10195 @ visibility ("read" )
10296 privateEndpointConnections ? : PrivateEndpointConnection [];
10397}
10498
105- @ doc ( " The mode that the Mongo Cluster is created with." )
99+ /** The mode that the Mongo Cluster is created with. */
106100union CreateMode {
107101 string ,
108102
109- @ doc ( " Create a new mongo cluster." )
103+ /** Create a new mongo cluster. */
110104 "Default" ,
111105
112- @ doc ( " Create a mongo cluster from a restore point-in-time." )
106+ /** Create a mongo cluster from a restore point-in-time. */
113107 "PointInTimeRestore" ,
114108}
115109
116- @ doc ( " The kind of the node on the cluster." )
110+ /** The kind of the node on the cluster. */
117111union NodeKind {
118112 string ,
119113
120- @ doc ( " The node is a shard kind." )
114+ /** The node is a shard kind. */
121115 "Shard" ,
122116}
123117
124- @ doc ( " Parameters used for restore operations" )
118+ /** Parameters used for restore operations */
125119model MongoClusterRestoreParameters {
120+ /** UTC point in time to restore a mongo cluster */
126121 #suppress "@azure-tools/typespec-azure-core/casing-style" "Capitialized acronym in the property name."
127- @ doc ("UTC point in time to restore a mongo cluster" )
128122 pointInTimeUTC ? : utcDateTime ;
129123
130- @ doc ( " Resource ID to locate the source cluster to restore" )
124+ /** Resource ID to locate the source cluster to restore */
131125 sourceResourceId ? : string ;
132126}
133127
134- @ doc ( " Specification for a node group." )
128+ /** Specification for a node group. */
135129model NodeGroupSpec is NodeGroupProperties {
136- @ doc ( " The node type deployed in the node group." )
130+ /** The node type deployed in the node group. */
137131 kind ? : NodeKind ;
138132
139- @ doc ( " The number of nodes in the node group." )
133+ /** The number of nodes in the node group. */
140134 nodeCount ? : int32 ;
141135}
142136
143- @ doc ( " The properties of the node group on a cluster." )
137+ /** The properties of the node group on a cluster. */
144138model NodeGroupProperties {
145- @ doc ( " The resource sku for the node group. This defines the size of CPU and memory that is provisioned for each node. Example values: 'M30', 'M40'." )
139+ /** The resource sku for the node group. This defines the size of CPU and memory that is provisioned for each node. Example values: 'M30', 'M40'. */
146140 sku ? : string ;
147141
142+ /** The disk storage size for the node group in GB. Example values: 128, 256, 512, 1024. */
148143 #suppress "@azure-tools/typespec-azure-core/casing-style" "Capitialized acronym in the property name."
149- @ doc ("The disk storage size for the node group in GB. Example values: 128, 256, 512, 1024." )
150144 diskSizeGB ? : int64 ;
151145
152- @ doc ( " Whether high availability is enabled on the node group." )
146+ /** Whether high availability is enabled on the node group. */
153147 enableHa ? : boolean ;
154148}
155149
156- @ doc ( " The connection strings for the given mongo cluster." )
150+ /** The connection strings for the given mongo cluster. */
157151model ListConnectionStringsResult {
158- @ doc ( " An array that contains the connection strings for a mongo cluster." )
152+ /** An array that contains the connection strings for a mongo cluster. */
159153 @ visibility ("read" )
160154 @ extension ("x-ms-identifiers" , [])
161155 connectionStrings ? : ConnectionString [];
162156}
163157
164- @ doc ( " Connection string for the mongo cluster" )
158+ /** Connection string for the mongo cluster */
165159model ConnectionString {
160+ /** Value of the connection string */
166161 #suppress "@azure-tools/typespec-azure-core/property-name-conflict" "https://github.com/Azure/typespec-azure/issues/417"
167- @ doc ("Value of the connection string" )
168162 @ visibility ("read" )
169163 @ clientName ("uri" , "csharp" )
170164 connectionString ? : string ;
171165
172- @ doc ( " Description of the connection string" )
166+ /** Description of the connection string */
173167 @ visibility ("read" )
174168 description ? : string ;
175169}
176170
177- @ doc ( " The status of the Mongo cluster resource." )
171+ /** The status of the Mongo cluster resource. */
178172union MongoClusterStatus {
179173 string ,
180174
181- @ doc ( " The mongo cluster resource is ready for use." )
175+ /** The mongo cluster resource is ready for use. */
182176 "Ready" ,
183177
184- @ doc ( " The mongo cluster resource is being provisioned." )
178+ /** The mongo cluster resource is being provisioned. */
185179 "Provisioning" ,
186180
187- @ doc ( " The mongo cluster resource is being updated." )
181+ /** The mongo cluster resource is being updated. */
188182 "Updating" ,
189183
190- @ doc ( " The mongo cluster resource is being started." )
184+ /** The mongo cluster resource is being started. */
191185 "Starting" ,
192186
193- @ doc ( " The mongo cluster resource is being stopped." )
187+ /** The mongo cluster resource is being stopped. */
194188 "Stopping" ,
195189
196- @ doc ( " The mongo cluster resource is stopped." )
190+ /** The mongo cluster resource is stopped. */
197191 "Stopped" ,
198192
199- @ doc ( " The mongo cluster resource is being dropped." )
193+ /** The mongo cluster resource is being dropped. */
200194 "Dropping" ,
201195}
202196
203- @ doc ( " Whether or not public endpoint access is allowed for this Mongo cluster. Value is optional and default value is 'Enabled'" )
197+ /** Whether or not public endpoint access is allowed for this Mongo cluster. Value is optional and default value is 'Enabled' */
204198union PublicNetworkAccess {
205199 string ,
206200
207- @ doc ( " If set, mongo cluster can be accessed through private and public methods." )
201+ /** If set, mongo cluster can be accessed through private and public methods. */
208202 "Enabled" ,
209203
210- @ doc ( " If set, the private endpoints are the exclusive access method." )
204+ /** If set, the private endpoints are the exclusive access method. */
211205 "Disabled" ,
212206}
0 commit comments