Skip to content
Closed
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
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.1 (2023-06-15)

- Azure Resource Manager CosmosDBForPostgreSql client library for Java. This package contains Microsoft Azure SDK for CosmosDBForPostgreSql Management SDK. Azure Cosmos DB for PostgreSQL database service resource provider REST APIs. Package tag package-2022-11-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-cosmosdbforpostgresql</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,61 +94,108 @@ import java.util.Map;
/** Samples for Clusters Create. */
public final class ClustersCreateSamples {
/*
* x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreateReadReplica.json
* x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreateSingleNode.json
*/
/**
* Sample code: Create a new cluster as a read replica.
* Sample code: Create a new single node cluster.
*
* @param manager Entry point to CosmosDBForPostgreSqlManager.
*/
public static void createANewClusterAsAReadReplica(
public static void createANewSingleNodeCluster(
com.azure.resourcemanager.cosmosdbforpostgresql.CosmosDBForPostgreSqlManager manager) {
manager
.clusters()
.define("testcluster")
.define("testcluster-singlenode")
.withRegion("westus")
.withExistingResourceGroup("TestGroup")
.withSourceResourceId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/sourcecluster")
.withSourceLocation("westus")
.withTags(mapOf("owner", "JohnDoe"))
.withAdministratorLoginPassword("password")
.withPostgresqlVersion("15")
.withCitusVersion("11.3")
.withPreferredPrimaryZone("1")
.withEnableShardsOnCoordinator(true)
.withEnableHa(true)
.withCoordinatorServerEdition("GeneralPurpose")
.withCoordinatorStorageQuotaInMb(131072)
.withCoordinatorVCores(8)
.withCoordinatorEnablePublicIpAccess(true)
.withNodeCount(0)
.create();
}

/*
* x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreatePITR.json
* x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreateBurstablev1.json
*/
/**
* Sample code: Create a new cluster as a point in time restore.
* Sample code: Create a new single node Burstable 1 vCore cluster.
*
* @param manager Entry point to CosmosDBForPostgreSqlManager.
*/
public static void createANewClusterAsAPointInTimeRestore(
public static void createANewSingleNodeBurstable1VCoreCluster(
com.azure.resourcemanager.cosmosdbforpostgresql.CosmosDBForPostgreSqlManager manager) {
manager
.clusters()
.define("testcluster")
.define("testcluster-burstablev1")
.withRegion("westus")
.withExistingResourceGroup("TestGroup")
.withSourceResourceId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/source-cluster")
.withSourceLocation("westus")
.withPointInTimeUtc(OffsetDateTime.parse("2017-12-14T00:00:37.467Z"))
.withTags(mapOf("owner", "JohnDoe"))
.withAdministratorLoginPassword("password")
.withPostgresqlVersion("15")
.withCitusVersion("11.3")
.withPreferredPrimaryZone("1")
.withEnableShardsOnCoordinator(true)
.withEnableHa(false)
.withCoordinatorServerEdition("BurstableMemoryOptimized")
.withCoordinatorStorageQuotaInMb(131072)
.withCoordinatorVCores(1)
.withCoordinatorEnablePublicIpAccess(true)
.withNodeCount(0)
.create();
}

/*
* x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreate.json
* x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreateBurstablev2.json
*/
/**
* Sample code: Create a new cluster.
* Sample code: Create a new single node Burstable 2 vCores cluster.
*
* @param manager Entry point to CosmosDBForPostgreSqlManager.
*/
public static void createANewCluster(
public static void createANewSingleNodeBurstable2VCoresCluster(
com.azure.resourcemanager.cosmosdbforpostgresql.CosmosDBForPostgreSqlManager manager) {
manager
.clusters()
.define("testcluster")
.define("testcluster-burstablev2")
.withRegion("westus")
.withExistingResourceGroup("TestGroup")
.withTags(mapOf("owner", "JohnDoe"))
.withAdministratorLoginPassword("password")
.withPostgresqlVersion("15")
.withCitusVersion("11.3")
.withPreferredPrimaryZone("1")
.withEnableShardsOnCoordinator(true)
.withEnableHa(false)
.withCoordinatorServerEdition("BurstableGeneralPurpose")
.withCoordinatorStorageQuotaInMb(131072)
.withCoordinatorVCores(2)
.withCoordinatorEnablePublicIpAccess(true)
.withNodeCount(0)
.create();
}

/*
* x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreateMultiNode.json
*/
/**
* Sample code: Create a new multi-node cluster.
*
* @param manager Entry point to CosmosDBForPostgreSqlManager.
*/
public static void createANewMultiNodeCluster(
com.azure.resourcemanager.cosmosdbforpostgresql.CosmosDBForPostgreSqlManager manager) {
manager
.clusters()
.define("testcluster-multinode")
.withRegion("westus")
.withExistingResourceGroup("TestGroup")
.withTags(mapOf())
Expand All @@ -170,6 +217,49 @@ public final class ClustersCreateSamples {
.create();
}

/*
* x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreateReadReplica.json
*/
/**
* Sample code: Create a new cluster as a read replica.
*
* @param manager Entry point to CosmosDBForPostgreSqlManager.
*/
public static void createANewClusterAsAReadReplica(
com.azure.resourcemanager.cosmosdbforpostgresql.CosmosDBForPostgreSqlManager manager) {
manager
.clusters()
.define("testcluster")
.withRegion("westus")
.withExistingResourceGroup("TestGroup")
.withSourceResourceId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/sourcecluster")
.withSourceLocation("westus")
.create();
}

/*
* x-ms-original-file: specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/examples/ClusterCreatePITR.json
*/
/**
* Sample code: Create a new cluster as a point in time restore.
*
* @param manager Entry point to CosmosDBForPostgreSqlManager.
*/
public static void createANewClusterAsAPointInTimeRestore(
com.azure.resourcemanager.cosmosdbforpostgresql.CosmosDBForPostgreSqlManager manager) {
manager
.clusters()
.define("testcluster")
.withRegion("westus")
.withExistingResourceGroup("TestGroup")
.withSourceResourceId(
"/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestResourceGroup/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/source-cluster")
.withSourceLocation("westus")
.withPointInTimeUtc(OffsetDateTime.parse("2017-12-14T00:00:37.467Z"))
.create();
}

@SuppressWarnings("unchecked")
private static <T> Map<String, T> mapOf(Object... inputs) {
Map<String, T> map = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ public ClusterInner withPreferredPrimaryZone(String preferredPrimaryZone) {
}

/**
* Get the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the cluster.
* Get the enableShardsOnCoordinator property: If distributed tables are placed on coordinator or not. Should be set
* to 'true' on single node clusters. Requires shard rebalancing after value is changed.
*
* @return the enableShardsOnCoordinator value.
*/
Expand All @@ -218,7 +219,8 @@ public Boolean enableShardsOnCoordinator() {
}

/**
* Set the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the cluster.
* Set the enableShardsOnCoordinator property: If distributed tables are placed on coordinator or not. Should be set
* to 'true' on single node clusters. Requires shard rebalancing after value is changed.
*
* @param enableShardsOnCoordinator the enableShardsOnCoordinator value to set.
* @return the ClusterInner object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public final class ClusterProperties {
private String preferredPrimaryZone;

/*
* If shards on coordinator is enabled or not for the cluster.
* If distributed tables are placed on coordinator or not. Should be set to 'true' on single node clusters.
* Requires shard rebalancing after value is changed.
*/
@JsonProperty(value = "enableShardsOnCoordinator")
private Boolean enableShardsOnCoordinator;
Expand Down Expand Up @@ -309,7 +310,8 @@ public ClusterProperties withPreferredPrimaryZone(String preferredPrimaryZone) {
}

/**
* Get the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the cluster.
* Get the enableShardsOnCoordinator property: If distributed tables are placed on coordinator or not. Should be set
* to 'true' on single node clusters. Requires shard rebalancing after value is changed.
*
* @return the enableShardsOnCoordinator value.
*/
Expand All @@ -318,7 +320,8 @@ public Boolean enableShardsOnCoordinator() {
}

/**
* Set the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the cluster.
* Set the enableShardsOnCoordinator property: If distributed tables are placed on coordinator or not. Should be set
* to 'true' on single node clusters. Requires shard rebalancing after value is changed.
*
* @param enableShardsOnCoordinator the enableShardsOnCoordinator value to set.
* @return the ClusterProperties object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public final class ClusterPropertiesForUpdate {
private String citusVersion;

/*
* If shards on coordinator is enabled or not for the cluster.
* If distributed tables are placed on coordinator or not. Should be set to 'true' on single node clusters.
* Requires shard rebalancing after value is changed.
*/
@JsonProperty(value = "enableShardsOnCoordinator")
private Boolean enableShardsOnCoordinator;
Expand Down Expand Up @@ -177,7 +178,8 @@ public ClusterPropertiesForUpdate withCitusVersion(String citusVersion) {
}

/**
* Get the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the cluster.
* Get the enableShardsOnCoordinator property: If distributed tables are placed on coordinator or not. Should be set
* to 'true' on single node clusters. Requires shard rebalancing after value is changed.
*
* @return the enableShardsOnCoordinator value.
*/
Expand All @@ -186,7 +188,8 @@ public Boolean enableShardsOnCoordinator() {
}

/**
* Set the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the cluster.
* Set the enableShardsOnCoordinator property: If distributed tables are placed on coordinator or not. Should be set
* to 'true' on single node clusters. Requires shard rebalancing after value is changed.
*
* @param enableShardsOnCoordinator the enableShardsOnCoordinator value to set.
* @return the ClusterPropertiesForUpdate object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ public interface Cluster {
String preferredPrimaryZone();

/**
* Gets the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the cluster.
* Gets the enableShardsOnCoordinator property: If distributed tables are placed on coordinator or not. Should be
* set to 'true' on single node clusters. Requires shard rebalancing after value is changed.
*
* @return the enableShardsOnCoordinator value.
*/
Expand Down Expand Up @@ -418,10 +419,11 @@ interface WithPreferredPrimaryZone {
/** The stage of the Cluster definition allowing to specify enableShardsOnCoordinator. */
interface WithEnableShardsOnCoordinator {
/**
* Specifies the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the
* cluster..
* Specifies the enableShardsOnCoordinator property: If distributed tables are placed on coordinator or not.
* Should be set to 'true' on single node clusters. Requires shard rebalancing after value is changed..
*
* @param enableShardsOnCoordinator If shards on coordinator is enabled or not for the cluster.
* @param enableShardsOnCoordinator If distributed tables are placed on coordinator or not. Should be set to
* 'true' on single node clusters. Requires shard rebalancing after value is changed.
* @return the next definition stage.
*/
WithCreate withEnableShardsOnCoordinator(Boolean enableShardsOnCoordinator);
Expand Down Expand Up @@ -658,10 +660,11 @@ interface WithCitusVersion {
/** The stage of the Cluster update allowing to specify enableShardsOnCoordinator. */
interface WithEnableShardsOnCoordinator {
/**
* Specifies the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the
* cluster..
* Specifies the enableShardsOnCoordinator property: If distributed tables are placed on coordinator or not.
* Should be set to 'true' on single node clusters. Requires shard rebalancing after value is changed..
*
* @param enableShardsOnCoordinator If shards on coordinator is enabled or not for the cluster.
* @param enableShardsOnCoordinator If distributed tables are placed on coordinator or not. Should be set to
* 'true' on single node clusters. Requires shard rebalancing after value is changed.
* @return the next definition stage.
*/
Update withEnableShardsOnCoordinator(Boolean enableShardsOnCoordinator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ public ClusterForUpdate withCitusVersion(String citusVersion) {
}

/**
* Get the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the cluster.
* Get the enableShardsOnCoordinator property: If distributed tables are placed on coordinator or not. Should be set
* to 'true' on single node clusters. Requires shard rebalancing after value is changed.
*
* @return the enableShardsOnCoordinator value.
*/
Expand All @@ -140,7 +141,8 @@ public Boolean enableShardsOnCoordinator() {
}

/**
* Set the enableShardsOnCoordinator property: If shards on coordinator is enabled or not for the cluster.
* Set the enableShardsOnCoordinator property: If distributed tables are placed on coordinator or not. Should be set
* to 'true' on single node clusters. Requires shard rebalancing after value is changed.
*
* @param enableShardsOnCoordinator the enableShardsOnCoordinator value to set.
* @return the ClusterForUpdate object itself.
Expand Down
Loading