Skip to content

confluent cli description update #8786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions src/confluent/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
1.0.0
+++++
* Updated CLI command descriptions to be more user and support az mcp commands.

0.6.0
+++++
* Added more commands for user access management
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"confluent organization",
)
class __CMDGroup(AAZCommandGroup):
"""Commands to perform actions on a confluent organization
"""Perform administrative operations on Confluent organization entities via Azure.
"""
pass

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from ._create_user import *
from ._delete import *
from ._list import *
from ._list_region import *
from ._list_role_binding import *
from ._list_service_accounts import *
from ._list_users import *
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"confluent organization create",
)
class Create(AAZCommand):
"""Create Organization resource
"""Create a new Confluent organization entity through Azure integration.
"""

_aaz_info = {
Expand Down Expand Up @@ -48,8 +48,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
required=True,
)
_args_schema.resource_group = AAZResourceGroupNameArg(
options=["--resource-group"],
help="Resource Group Name",
required=True,
)

Expand Down Expand Up @@ -176,7 +174,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="Email address",
required=True,
fmt=AAZStrArgFormat(
pattern="^\S+@\S+\.\S+$",
pattern="^\\S+@\\S+\\.\\S+$",
),
)
user_detail.first_name = AAZStrArg(
Expand Down Expand Up @@ -401,6 +399,7 @@ def _build_schema_on_200_201(cls):
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.sso_url = AAZStrType(
serialized_name="ssoUrl",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"confluent organization create-role-binding",
)
class CreateRoleBinding(AAZCommand):
"""Organization role bindings
"""Assign roles to users or groups within a Confluent organization.
"""

_aaz_info = {
Expand Down Expand Up @@ -48,8 +48,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
id_part="name",
)
_args_schema.resource_group = AAZResourceGroupNameArg(
options=["--resource-group"],
help="Resource group name",
required=True,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"confluent organization create-user",
)
class CreateUser(AAZCommand):
"""Invite user to the organization
"""Invite a new user to join the Confluent organization.
"""

_aaz_info = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
confirmation="Are you sure you want to perform this operation?",
)
class Delete(AAZCommand):
"""Delete Organization resource
"""Delete an existing Confluent organization entity via Azure.
"""

_aaz_info = {
Expand Down Expand Up @@ -50,8 +50,6 @@ def _build_arguments_schema(cls, *args, **kwargs):
id_part="name",
)
_args_schema.resource_group = AAZResourceGroupNameArg(
options=["--resource-group"],
help="Resource Group Name",
required=True,
)
return cls._args_schema
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"confluent organization list",
)
class List(AAZCommand):
"""List all organizations under the specified subscription.
"""List all Confluent organizations under the specified resource group or subscription.
"""

_aaz_info = {
Expand Down Expand Up @@ -43,20 +43,17 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group ""

_args_schema = cls._args_schema
_args_schema.resource_group = AAZResourceGroupNameArg(
options=["--resource-group"],
help="Resource Group Name",
)
_args_schema.resource_group = AAZResourceGroupNameArg()
return cls._args_schema

def _execute_operations(self):
self.pre_operations()
condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
Copy link
Preview

Copilot AI May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic for determining which inner class to invoke (i.e. OrganizationListBySubscription versus OrganizationListByResourceGroup) relies on dividing conditions in a non-obvious way. Consider refactoring or adding inline comments to clarify the intent and ensure that each endpoint URL aligns with the corresponding condition.

Copilot uses AI. Check for mistakes.

condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
if condition_0:
self.OrganizationListByResourceGroup(ctx=self.ctx)()
if condition_1:
self.OrganizationListBySubscription(ctx=self.ctx)()
if condition_1:
self.OrganizationListByResourceGroup(ctx=self.ctx)()
self.post_operations()

@register_callback
Expand All @@ -72,7 +69,7 @@ def _output(self, *args, **kwargs):
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
return result, next_link

class OrganizationListByResourceGroup(AAZHttpOperation):
class OrganizationListBySubscription(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -86,7 +83,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations",
"/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations",
**self.url_parameters
)

Expand All @@ -101,10 +98,6 @@ def error_format(self):
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
Expand Down Expand Up @@ -192,6 +185,7 @@ def _build_schema_on_200(cls):
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.sso_url = AAZStrType(
serialized_name="ssoUrl",
Expand Down Expand Up @@ -279,7 +273,7 @@ def _build_schema_on_200(cls):

return cls._schema_on_200

class OrganizationListBySubscription(AAZHttpOperation):
class OrganizationListByResourceGroup(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -293,7 +287,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations",
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations",
**self.url_parameters
)

Expand All @@ -308,6 +302,10 @@ def error_format(self):
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
Expand Down Expand Up @@ -395,6 +393,7 @@ def _build_schema_on_200(cls):
)
properties.provisioning_state = AAZStrType(
serialized_name="provisioningState",
flags={"read_only": True},
)
properties.sso_url = AAZStrType(
serialized_name="ssoUrl",
Expand Down
Loading
Loading