Skip to content

Commit

Permalink
Generated from 6dc88857bdcf5ba185555564f857c9d389297e44 (#1385)
Browse files Browse the repository at this point in the history
Update MariaDB default API version to 2018-06-01
  • Loading branch information
AutorestCI authored Mar 1, 2019
1 parent 30eaeee commit c15b992
Show file tree
Hide file tree
Showing 9 changed files with 298 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/@azure/arm-mariadb/lib/mariaDBManagementClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { MariaDBManagementClientContext } from "./mariaDBManagementClientContext
class MariaDBManagementClient extends MariaDBManagementClientContext {
// Operation groups
servers: operations.Servers;
replicas: operations.Replicas;
firewallRules: operations.FirewallRules;
virtualNetworkRules: operations.VirtualNetworkRules;
databases: operations.Databases;
Expand All @@ -37,6 +38,7 @@ class MariaDBManagementClient extends MariaDBManagementClientContext {
constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.MariaDBManagementClientOptions) {
super(credentials, subscriptionId, options);
this.servers = new operations.Servers(this);
this.replicas = new operations.Replicas(this);
this.firewallRules = new operations.FirewallRules(this);
this.virtualNetworkRules = new operations.VirtualNetworkRules(this);
this.databases = new operations.Databases(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class MariaDBManagementClientContext extends msRestAzure.AzureServiceClie

super(credentials, options);

this.apiVersion = '2018-06-01-preview';
this.apiVersion = '2018-06-01';
this.acceptLanguage = 'en-US';
this.longRunningOperationRetryTimeout = 30;
this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
Expand Down
71 changes: 70 additions & 1 deletion packages/@azure/arm-mariadb/lib/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export interface StorageProfile {
/**
* Contains the possible cases for ServerPropertiesForCreate.
*/
export type ServerPropertiesForCreateUnion = ServerPropertiesForCreate | ServerPropertiesForDefaultCreate | ServerPropertiesForRestore | ServerPropertiesForGeoRestore;
export type ServerPropertiesForCreateUnion = ServerPropertiesForCreate | ServerPropertiesForDefaultCreate | ServerPropertiesForRestore | ServerPropertiesForGeoRestore | ServerPropertiesForReplica;

/**
* @interface
Expand Down Expand Up @@ -222,6 +222,38 @@ export interface ServerPropertiesForGeoRestore {
sourceServerId: string;
}

/**
* @interface
* An interface representing ServerPropertiesForReplica.
* The properties to create a new replica.
*
*/
export interface ServerPropertiesForReplica {
/**
* @member {string} createMode Polymorphic Discriminator
*/
createMode: "Replica";
/**
* @member {ServerVersion} [version] Server version. Possible values include:
* '5.6', '5.7'
*/
version?: ServerVersion;
/**
* @member {SslEnforcementEnum} [sslEnforcement] Enable ssl enforcement or
* not when connect to server. Possible values include: 'Enabled', 'Disabled'
*/
sslEnforcement?: SslEnforcementEnum;
/**
* @member {StorageProfile} [storageProfile] Storage profile of a server.
*/
storageProfile?: StorageProfile;
/**
* @member {string} sourceServerId The master server id to create replica
* from.
*/
sourceServerId: string;
}

/**
* @interface
* An interface representing Sku.
Expand Down Expand Up @@ -302,6 +334,20 @@ export interface Server extends TrackedResource {
* @member {StorageProfile} [storageProfile] Storage profile of a server.
*/
storageProfile?: StorageProfile;
/**
* @member {string} [replicationRole] The replication role of the server.
*/
replicationRole?: string;
/**
* @member {string} [masterServerId] The master server id of a replica
* server.
*/
masterServerId?: string;
/**
* @member {number} [replicaCapacity] The maximum number of replicas that a
* master server can have.
*/
replicaCapacity?: number;
}

/**
Expand Down Expand Up @@ -361,6 +407,10 @@ export interface ServerUpdateParameters {
* not when connect to server. Possible values include: 'Enabled', 'Disabled'
*/
sslEnforcement?: SslEnforcementEnum;
/**
* @member {string} [replicationRole] The replication role of the server.
*/
replicationRole?: string;
/**
* @member {{ [propertyName: string]: string }} [tags] Application-specific
* metadata in the form of key-value pairs.
Expand Down Expand Up @@ -1030,6 +1080,25 @@ export type ServersBeginUpdateResponse = Server & {
};
};

/**
* Contains response data for the listByServer operation.
*/
export type ReplicasListByServerResponse = ServerListResult & {
/**
* The underlying HTTP response.
*/
_response: msRest.HttpResponse & {
/**
* The response body as text (string format)
*/
bodyAsText: string;
/**
* The response body as parsed JSON or XML
*/
parsedBody: ServerListResult;
};
};

/**
* Contains response data for the createOrUpdate operation.
*/
Expand Down
50 changes: 49 additions & 1 deletion packages/@azure/arm-mariadb/lib/models/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,26 @@ export const ServerPropertiesForGeoRestore: msRest.CompositeMapper = {
}
};

export const ServerPropertiesForReplica: msRest.CompositeMapper = {
serializedName: "Replica",
type: {
name: "Composite",
polymorphicDiscriminator: ServerPropertiesForCreate.type.polymorphicDiscriminator,
uberParent: "ServerPropertiesForCreate",
className: "ServerPropertiesForReplica",
modelProperties: {
...ServerPropertiesForCreate.type.modelProperties,
sourceServerId: {
required: true,
serializedName: "sourceServerId",
type: {
name: "String"
}
}
}
}
};

export const Sku: msRest.CompositeMapper = {
serializedName: "Sku",
type: {
Expand Down Expand Up @@ -324,6 +344,27 @@ export const Server: msRest.CompositeMapper = {
name: "Composite",
className: "StorageProfile"
}
},
replicationRole: {
serializedName: "properties.replicationRole",
type: {
name: "String"
}
},
masterServerId: {
serializedName: "properties.masterServerId",
type: {
name: "String"
}
},
replicaCapacity: {
serializedName: "properties.replicaCapacity",
constraints: {
InclusiveMinimum: 0
},
type: {
name: "Number"
}
}
}
}
Expand Down Expand Up @@ -414,6 +455,12 @@ export const ServerUpdateParameters: msRest.CompositeMapper = {
]
}
},
replicationRole: {
serializedName: "properties.replicationRole",
type: {
name: "String"
}
},
tags: {
serializedName: "tags",
type: {
Expand Down Expand Up @@ -1084,5 +1131,6 @@ export const discriminators = {
'ServerPropertiesForCreate' : ServerPropertiesForCreate,
'ServerPropertiesForCreate.Default' : ServerPropertiesForDefaultCreate,
'ServerPropertiesForCreate.PointInTimeRestore' : ServerPropertiesForRestore,
'ServerPropertiesForCreate.GeoRestore' : ServerPropertiesForGeoRestore
'ServerPropertiesForCreate.GeoRestore' : ServerPropertiesForGeoRestore,
'ServerPropertiesForCreate.Replica' : ServerPropertiesForReplica
};
28 changes: 28 additions & 0 deletions packages/@azure/arm-mariadb/lib/models/replicasMappers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

export {
discriminators,
ServerListResult,
Server,
TrackedResource,
ProxyResource,
BaseResource,
Sku,
StorageProfile,
CloudError,
FirewallRule,
VirtualNetworkRule,
Database,
Configuration,
LogFile,
ServerSecurityAlertPolicy
} from "../models/mappers";

1 change: 1 addition & 0 deletions packages/@azure/arm-mariadb/lib/models/serversMappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export {
ServerPropertiesForDefaultCreate,
ServerPropertiesForRestore,
ServerPropertiesForGeoRestore,
ServerPropertiesForReplica,
FirewallRule,
VirtualNetworkRule,
Database,
Expand Down
1 change: 1 addition & 0 deletions packages/@azure/arm-mariadb/lib/operations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

export * from "./servers";
export * from "./replicas";
export * from "./firewallRules";
export * from "./virtualNetworkRules";
export * from "./databases";
Expand Down
90 changes: 90 additions & 0 deletions packages/@azure/arm-mariadb/lib/operations/replicas.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/

import * as msRest from "@azure/ms-rest-js";
import * as Models from "../models";
import * as Mappers from "../models/replicasMappers";
import * as Parameters from "../models/parameters";
import { MariaDBManagementClientContext } from "../mariaDBManagementClientContext";

/** Class representing a Replicas. */
export class Replicas {
private readonly client: MariaDBManagementClientContext;

/**
* Create a Replicas.
* @param {MariaDBManagementClientContext} client Reference to the service client.
*/
constructor(client: MariaDBManagementClientContext) {
this.client = client;
}

/**
* List all the replicas for a given server.
* @param resourceGroupName The name of the resource group that contains the resource. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param serverName The name of the server.
* @param [options] The optional parameters
* @returns Promise<Models.ReplicasListByServerResponse>
*/
listByServer(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase): Promise<Models.ReplicasListByServerResponse>;
/**
* @param resourceGroupName The name of the resource group that contains the resource. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param serverName The name of the server.
* @param callback The callback
*/
listByServer(resourceGroupName: string, serverName: string, callback: msRest.ServiceCallback<Models.ServerListResult>): void;
/**
* @param resourceGroupName The name of the resource group that contains the resource. You can
* obtain this value from the Azure Resource Manager API or the portal.
* @param serverName The name of the server.
* @param options The optional parameters
* @param callback The callback
*/
listByServer(resourceGroupName: string, serverName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ServerListResult>): void;
listByServer(resourceGroupName: string, serverName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ServerListResult>, callback?: msRest.ServiceCallback<Models.ServerListResult>): Promise<Models.ReplicasListByServerResponse> {
return this.client.sendOperationRequest(
{
resourceGroupName,
serverName,
options
},
listByServerOperationSpec,
callback) as Promise<Models.ReplicasListByServerResponse>;
}
}

// Operation Specifications
const serializer = new msRest.Serializer(Mappers);
const listByServerOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMariaDB/servers/{serverName}/replicas",
urlParameters: [
Parameters.subscriptionId,
Parameters.resourceGroupName,
Parameters.serverName
],
queryParameters: [
Parameters.apiVersion
],
headerParameters: [
Parameters.acceptLanguage
],
responses: {
200: {
bodyMapper: Mappers.ServerListResult
},
default: {
bodyMapper: Mappers.CloudError
}
},
serializer
};
Loading

0 comments on commit c15b992

Please sign in to comment.