Skip to content

Commit 2aab993

Browse files
feat(neon): flatten command hierarchy remove legacy 'neon postgres' group (1.0.0b5)
1 parent 37358a1 commit 2aab993

41 files changed

Lines changed: 393 additions & 67 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/neon/HISTORY.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
Release History
44
===============
55

6-
1.0.0b1
6+
1.0.0b5
77
++++++
8-
* Initial release.
9-
8+
* Flatten command hierarchy: removed duplicate 'neon postgres' group; all commands now under top-level 'neon'.
9+
* Added consolidated help content.
1010
1.0.0b2
1111
++++++
1212
* Updated command descriptions.
@@ -17,4 +17,9 @@ Release History
1717

1818
1.0.0b4
1919
++++++
20-
* Update the CLI command description to support AI related queries.
20+
* Update the CLI command description to support AI related queries.
21+
22+
1.0.0b5
23+
++++++
24+
* Flatten command hierarchy: deprecate duplicate 'neon postgres' group in favor of top-level 'neon'.
25+
* Add consolidated help content and deprecation notice.

src/neon/azext_neon/_help.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,18 @@
99
# pylint: disable=too-many-lines
1010

1111
from knack.help_files import helps # pylint: disable=unused-import
12+
13+
helps["neon"] = """
14+
type: group
15+
short-summary: Manage Neon Serverless Postgres resources (organizations, projects, branches, databases, roles, endpoints, compute).
16+
long-summary: |-
17+
Manage Neon serverless Postgres on Azure including:
18+
* Organization lifecycle
19+
* Project management
20+
* Branch management
21+
* Database operations
22+
* Role management
23+
* Compute / endpoints
24+
NOTE: Previous nested usage 'az neon postgres <subgroup>' is deprecated. Use 'az neon <subgroup>'.
25+
"""
26+

src/neon/azext_neon/aaz/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
#
55
# Code generated by aaz-dev-tools
66
# --------------------------------------------------------------------------------------------
7+
8+
from . import latest

src/neon/azext_neon/aaz/latest/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
# pylint: skip-file
99
# flake8: noqa
1010

11+
from . import neon

src/neon/azext_neon/aaz/latest/neon/__cmd_group.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
"neon",
1616
)
1717
class __CMDGroup(AAZCommandGroup):
18-
"""Manage Neon Postgres databases and related resources within Azure.
18+
"""Manage Neon Serverless Postgres resources including organizations, projects, and branches.
1919
"""
2020
pass
2121

2222

2323
__all__ = ["__CMDGroup"]
24+

src/neon/azext_neon/aaz/latest/neon/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
# flake8: noqa
1010

1111
from .__cmd_group import *
12+
from . import postgres

src/neon/azext_neon/aaz/latest/neon/postgres/__init__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,17 @@
88
# pylint: skip-file
99
# flake8: noqa
1010

11-
from .__cmd_group import *
11+
"""Loader for Neon subcommand groups without legacy 'neon postgres' wrapper.
12+
13+
The original generated package registered a duplicate root group 'neon postgres'.
14+
That group has been removed to flatten the hierarchy so only 'neon' appears in docs.
15+
"""
16+
1217
from ._create import *
18+
from . import branch
19+
from . import compute
20+
from . import endpoint
21+
from . import neon_database
22+
from . import neon_role
23+
from . import organization
24+
from . import project

src/neon/azext_neon/aaz/latest/neon/postgres/_create.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@
1111
from azure.cli.core.aaz import *
1212

1313

14+
@register_command(
15+
"neon create",
16+
)
1417
class Create(AAZCommand):
1518
"""Create a Neon organization
1619
17-
:example: Organizations_CreateOrUpdate
18-
az neon postgres create --resource-group demoResourceGroup --name demoNeonResource --location eastus --subscription 12345678-1234-1234-1234-123456789abc --marketplace-details "{subscription-id:abcd1234-5678-90ab-cdef-12345678abcd,subscription-status:PendingFulfillmentStart,offer-details:{publisher-id:microsoft,offer-id:neon-postgres,plan-id:serverless-plan,plan-name:'Neon Serverless Postgres - Free (Test_Liftr)',term-unit:P1M,term-id:term1234}}" --user-details "{first-name:John,last-name:Doe,email-address:johndoe@example.com,upn:johndoe,phone-number:+1234567890}" --company-details "{company-name:'DemoCompany',country:USA,business-phone:+9876543210,office-address:'123 Azure Ave, Redmond, WA',domain:democompany.com,number-of-employees:1000}" --partner-organization-properties "{organization-id:org-5678,org-name:'PartnerOrg',single-sign-on-properties:{single-sign-on-state:Enable,enterprise-app-id:app-9876,single-sign-on-url:'https://sso.partnerorg.com',aad-domains:['partnerorg.com']}}"
20+
:example: Create Neon Organization (Shortcut)
21+
az neon create --resource-group myResourceGroup --name myNeonOrg --location eastus --subscription 12345678-1234-1234-1234-123456789abc --marketplace-details "{subscription-id:abcd1234-5678-90ab-cdef-12345678abcd,subscription-status:Subscribed,offer-details:{publisher-id:neon1722366567200,offer-id:neon_serverless_postgres_azure_prod,plan-id:neon_serverless_postgres_azure_prod_free,plan-name:'Free Plan',term-unit:P1M,term-id:term1234}}" --user-details "{first-name:John,last-name:Doe,email-address:johndoe@example.com,upn:johndoe,phone-number:+1234567890}" --company-details "{company-name:'DemoCompany',country:USA,business-phone:+9876543210,office-address:'123 Azure Ave, Redmond, WA',domain:democompany.com,number-of-employees:1000}" --partner-organization-properties "{organization-id:org-5678,org-name:'PartnerOrg',single-sign-on-properties:{single-sign-on-state:Enable,enterprise-app-id:app-9876,single-sign-on-url:'https://sso.partnerorg.com',aad-domains:['partnerorg.com']}}"
1922
"""
2023

2124
_aaz_info = {
22-
"version": "2024-08-01-preview",
25+
"version": "2025-03-01",
2326
"resources": [
24-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2024-08-01-preview"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/neon.postgres/organizations/{}", "2025-03-01"],
2528
]
2629
}
2730

@@ -120,7 +123,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
120123
marketplace_details.subscription_status = AAZStrArg(
121124
options=["subscription-status"],
122125
help="Marketplace subscription status",
123-
enum={"PendingFulfillmentStart": "PendingFulfillmentStart", "Subscribed": "Subscribed", "Suspended": "Suspended", "Unsubscribed": "Unsubscribed"},
126+
enum={"Subscribed": "Subscribed", "Subscribed": "Subscribed", "Suspended": "Suspended", "Unsubscribed": "Unsubscribed"},
124127
)
125128

126129
offer_details = cls._args_schema.marketplace_details.offer_details
@@ -321,7 +324,7 @@ def url_parameters(self):
321324
def query_parameters(self):
322325
parameters = {
323326
**self.serialize_query_param(
324-
"api-version", "2024-08-01-preview",
327+
"api-version", "2025-03-01",
325328
required=True,
326329
),
327330
}

src/neon/azext_neon/aaz/latest/neon/postgres/branch/__cmd_group.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
@register_command_group(
15-
"neon postgres branch",
15+
"neon branch",
1616
)
1717
class __CMDGroup(AAZCommandGroup):
1818
"""Manage branches within a Neon Postgres database.

src/neon/azext_neon/aaz/latest/neon/postgres/branch/_create.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313

1414
@register_command(
15-
"neon postgres branch create",
15+
"neon branch create",
1616
)
1717
class Create(AAZCommand):
1818
"""Create a new branch within a Neon Postgres database.
1919
2020
:example: Create a Branch
21-
az neon postgres branch create --resource-group rgneon --organization-name org-cli-test --project-name old-frost-16758796 --branch-name test-branch --entity-name test-branch --role-name test_role --database-name testneondb
21+
az neon branch create --resource-group rgneon --organization-name org-cli-test --project-name old-frost-16758796 --branch-name test-branch --entity-name test-branch --role-name test_role --database-name testneondb
2222
"""
2323

2424
_aaz_info = {

0 commit comments

Comments
 (0)