Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b675ffe
convert
mcgallan Aug 5, 2025
b241f30
compile
mcgallan Aug 5, 2025
3503187
diff
mcgallan Aug 5, 2025
4344680
update
mcgallan Aug 6, 2025
00e11dc
Merge remote-tracking branch 'upstream/main' into convert-dbforpostgr…
mcgallan Aug 6, 2025
62a8f6d
update
mcgallan Aug 6, 2025
2a4aff0
update
mcgallan Aug 6, 2025
dbbf5e3
Merge remote-tracking branch 'upstream/main' into convert-dbforpostgr…
mcgallan Aug 7, 2025
0d7e561
Merge remote-tracking branch 'upstream/main' into convert-dbforpostgr…
mcgallan Aug 8, 2025
a7a2bfa
update
mcgallan Aug 8, 2025
4d1759f
update
mcgallan Aug 8, 2025
b56652a
foramt update
mcgallan Aug 8, 2025
14e5f5b
update spell check
mcgallan Aug 8, 2025
f60e2ab
Merge remote-tracking branch 'upstream/main' into convert-dbforpostgr…
mcgallan Aug 11, 2025
c8feeaa
update
mcgallan Aug 11, 2025
553655f
delete operationid
mcgallan Aug 11, 2025
adfe878
delete diff folder
mcgallan Aug 11, 2025
9f91a9f
update tspconfig
mcgallan Aug 11, 2025
038be54
update
mcgallan Aug 11, 2025
5842903
update readme
mcgallan Aug 12, 2025
5534cd5
Merge branch 'main' into convert-dbforpostgressql
mcgallan Aug 12, 2025
36332ae
remove consumes
mcgallan Aug 12, 2025
85dd257
fix empty files
mcgallan Aug 15, 2025
ffd460b
Merge remote-tracking branch 'upstream/main' into convert-dbforpostgr…
mcgallan Aug 18, 2025
f76048e
update
mcgallan Aug 18, 2025
b3521dc
Merge branch 'main' into convert-dbforpostgressql
mcgallan Aug 22, 2025
8571851
update PrivateEndpointConnection.tsp
mcgallan Aug 22, 2025
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,77 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Server.tsp";

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

namespace Microsoft.DBforPostgreSQL;
/**
* Server administrator associated to a Microsoft Entra principal.
*/
@parentResource(Server)
model AdministratorMicrosoftEntra
is Azure.ResourceManager.ProxyResource<
AdministratorMicrosoftEntraProperties,
false
> {
...ResourceNameParameter<
Resource = AdministratorMicrosoftEntra,
KeyName = "objectId",
SegmentName = "administrators",
NamePattern = ""
>;
}

@armResourceOperations
interface AdministratorMicrosoftEntras {
/**
* Gets information about a server administrator associated to a Microsoft Entra principal.
*/
get is ArmResourceRead<AdministratorMicrosoftEntra>;

/**
* Creates a new server administrator associated to a Microsoft Entra principal.
*/
@Azure.Core.useFinalStateVia("azure-async-operation")
@put
createOrUpdate is Azure.ResourceManager.Foundations.ArmCreateOperation<
ResourceInstanceParameters<
AdministratorMicrosoftEntra,
Azure.ResourceManager.Foundations.DefaultBaseParameters<AdministratorMicrosoftEntra>
>,
AdministratorMicrosoftEntraAdd,
Response = ArmAcceptedLroResponse<LroHeaders = ArmAsyncOperationHeader &
ArmLroLocationHeader &
Azure.Core.Foundations.RetryAfterHeader>,
ErrorResponse = ErrorResponse
>;

/**
* Deletes an existing server administrator associated to a Microsoft Entra principal.
*/
delete is ArmResourceDeleteWithoutOkAsync<AdministratorMicrosoftEntra>;

/**
* List all server administrators associated to a Microsoft Entra principal.
*/
listByServer is ArmResourceListByParent<
AdministratorMicrosoftEntra,
Response = ArmResponse<AdministratorMicrosoftEntraList>
>;
}

@@doc(AdministratorMicrosoftEntra.name,
"Object identifier of the Microsoft Entra principal."
);
@@doc(AdministratorMicrosoftEntra.properties,
"Properties of a server administrator associated to a Microsoft Entra principal."
);
@@doc(AdministratorMicrosoftEntras.createOrUpdate::parameters.resource,
"Required parameters for adding a server administrator associated to a Microsoft Entra principal."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Server.tsp";

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

namespace Microsoft.DBforPostgreSQL;
/**
* Advanced threat protection settings of the server.
*/
@parentResource(Server)
model AdvancedThreatProtectionSettingsModel
is Azure.ResourceManager.ProxyResource<AdvancedThreatProtectionSettingsProperties> {
...ResourceNameParameter<
Resource = AdvancedThreatProtectionSettingsModel,
KeyName = "threatProtectionName",
SegmentName = "advancedThreatProtectionSettings",
NamePattern = "",
Type = ThreatProtectionName
>;
}

#suppress "@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@armResourceOperations
interface AdvancedThreatProtectionSettingsModels {
/**
* Gets state of advanced threat protection settings for a server.
*/
get is ArmResourceRead<AdvancedThreatProtectionSettingsModel>;

/**
* Creates or updates a server's Advanced Threat Protection settings.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@Azure.Core.useFinalStateVia("azure-async-operation")
createOrUpdate is ArmResourceCreateOrReplaceAsync<
AdvancedThreatProtectionSettingsModel,
Response = ArmAcceptedLroResponse<LroHeaders = ArmAsyncOperationHeader &
ArmLroLocationHeader &
Azure.Core.Foundations.RetryAfterHeader>
>;

/**
* Lists state of advanced threat protection settings for a server.
*/
listByServer is ArmResourceListByParent<
AdvancedThreatProtectionSettingsModel,
Response = ArmResponse<AdvancedThreatProtectionSettingsList>
>;
}

@@doc(AdvancedThreatProtectionSettingsModel.name,
"Name of the advanced threat protection settings."
);
@@doc(AdvancedThreatProtectionSettingsModel.properties,
"Advanced threat protection properties."
);
@@doc(AdvancedThreatProtectionSettingsModels.createOrUpdate::parameters.resource,
"The Advanced Threat Protection state for the server."
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Server.tsp";
import "./legacy.tsp";

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

namespace Microsoft.DBforPostgreSQL;
/**
* Properties of a backup.
*/
@parentResource(Server)
model BackupAutomaticAndOnDemand
is Azure.ResourceManager.ProxyResource<BackupAutomaticAndOnDemandProperties> {
...ResourceNameParameter<
Resource = BackupAutomaticAndOnDemand,
KeyName = "backupName",
SegmentName = "backups",
NamePattern = "^[-\\w\\._]+$"
>;
}

@armResourceOperations
interface BackupAutomaticAndOnDemands {
/**
* Gets information of an on demand backup, given its name.
*/
get is ArmResourceRead<BackupAutomaticAndOnDemand>;

// FIXME: (ArmResourceCreateOrReplace): ArmResourceCreateOrReplaceAsync/ArmResourceCreateOrReplaceSync should have a body parameter.
/**
* Creates an on demand backup of a server.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@Azure.Core.useFinalStateVia("azure-async-operation")
create is CustomArmResourceCreateOrReplaceAsync<
BackupAutomaticAndOnDemand,
Response = ArmAcceptedLroResponse<LroHeaders = ArmAsyncOperationHeader &
ArmLroLocationHeader &
Azure.Core.Foundations.RetryAfterHeader>
>;

/**
* Deletes a specific backup, given its name.
*/
delete is ArmResourceDeleteWithoutOkAsync<BackupAutomaticAndOnDemand>;

/**
* Lists all available backups of a server.
*/
listByServer is ArmResourceListByParent<
BackupAutomaticAndOnDemand,
Response = ArmResponse<BackupAutomaticAndOnDemandList>
>;
}

@@maxLength(BackupAutomaticAndOnDemand.name, 128);
@@minLength(BackupAutomaticAndOnDemand.name, 1);
@@doc(BackupAutomaticAndOnDemand.name, "Name of the backup.");
@@doc(BackupAutomaticAndOnDemand.properties, "Properties of a backup.");
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Server.tsp";

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

namespace Microsoft.DBforPostgreSQL;
/**
* Response for the LTR backup Operation API call
*/
@parentResource(Server)
model BackupsLongTermRetentionOperation
is Azure.ResourceManager.ProxyResource<LtrBackupOperationResponseProperties> {
...ResourceNameParameter<
Resource = BackupsLongTermRetentionOperation,
KeyName = "backupName",
SegmentName = "ltrBackupOperations",
NamePattern = "^[-\\w\\._]+$"
>;
}

@armResourceOperations
interface BackupsLongTermRetentionOperations {
/**
* Gets the results of a long retention backup operation for a server.
*/
get is ArmResourceRead<BackupsLongTermRetentionOperation>;

/**
* Lists the results of the long term retention backup operations for a server.
*/
listByServer is ArmResourceListByParent<
BackupsLongTermRetentionOperation,
Response = ArmResponse<LtrServerBackupOperationList>
>;
}

@@doc(BackupsLongTermRetentionOperation.name, "The name of the backup.");
@@doc(BackupsLongTermRetentionOperation.properties,
"Long Term Retention Backup Operation Resource Properties"
);
@@minLength(BackupsLongTermRetentionOperation.name, 1);
@@maxLength(BackupsLongTermRetentionOperation.name, 128);
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
import "./Server.tsp";

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

namespace Microsoft.DBforPostgreSQL;
/**
* Configuration (also known as server parameter).
*/
@parentResource(Server)
model Configuration
is Azure.ResourceManager.ProxyResource<ConfigurationProperties> {
...ResourceNameParameter<
Resource = Configuration,
KeyName = "configurationName",
SegmentName = "configurations",
NamePattern = "^[-\\w\\._]+$"
>;
}

@armResourceOperations
interface Configurations {
/**
* Gets information about a specific configuration (also known as server parameter) of a server.
*/
get is ArmResourceRead<Configuration>;

/**
* Updates, using Put verb, the value assigned to a specific modifiable configuration (also known as server parameter) of a server.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@useFinalStateVia("azure-async-operation")
@put
put is Azure.ResourceManager.Foundations.ArmCreateOperation<
ResourceInstanceParameters<
Configuration,
Azure.ResourceManager.Foundations.DefaultBaseParameters<Configuration>
>,
ConfigurationForUpdate,
Response = ArmAcceptedLroResponse<LroHeaders = ArmAsyncOperationHeader &
ArmLroLocationHeader &
Azure.Core.Foundations.RetryAfterHeader>,
ErrorResponse = ErrorResponse
>;

/**
* Updates the value assigned to a specific modifiable configuration (also known as server parameter) of a server.
*/
@patch(#{ implicitOptionality: false })
@useFinalStateVia("azure-async-operation")
update is ArmCustomPatchAsync<
Configuration,
PatchModel = ConfigurationForUpdate,
Response = ArmAcceptedLroResponse<LroHeaders = ArmAsyncOperationHeader &
ArmLroLocationHeader &
Azure.Core.Foundations.RetryAfterHeader>
>;

/**
* Lists all configurations (also known as server parameters) of a server.
*/
listByServer is ArmResourceListByParent<
Configuration,
Response = ArmResponse<ConfigurationList>
>;
}

@@maxLength(Configuration.name, 256);
@@minLength(Configuration.name, 1);
@@doc(Configuration.name,
"Name of the configuration (also known as server parameter)."
);
@@doc(Configuration.properties,
"Properties of a configuration (also known as server parameter)."
);
@@doc(Configurations.put::parameters.resource,
"Parameters required to update the value of a specific modifiable configuration (also known as server parameter)."
);
@@doc(Configurations.update::parameters.properties,
"Parameters required to update the value of a specific modifiable configuration (also known as server parameter)."
);
Loading
Loading