From 65a1e0825b7598a5c1f1fd817ff50dd3f5d00521 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 30 Sep 2026 13:04:21 -0700 Subject: [PATCH 1/4] First --- .../account/costcontrol/_create.py | 107 ++++++++------ .../account/costcontrol/_list.py | 32 ++-- .../account/costcontrol/_show.py | 32 ++-- .../account/costcontrol/_update.py | 139 ++++++++++-------- 4 files changed, 176 insertions(+), 134 deletions(-) diff --git a/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_create.py b/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_create.py index abddbaa8778..b148d8ee1ba 100644 --- a/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_create.py +++ b/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_create.py @@ -176,62 +176,62 @@ def _build_arguments_schema(cls, *args, **kwargs): ) match = cls._args_schema.rules.Element.match - match.foundry_caller_agent_id = AAZListArg( - options=["foundry-caller-agent-id"], + match.agent_ids = AAZListArg( + options=["agent-ids"], help="The stable Foundry agent IDs to match.", fmt=AAZListArgFormat( max_length=20, min_length=1, ), ) - match.foundry_caller_identity_oid = AAZListArg( - options=["foundry-caller-identity-oid"], + match.identity_object_ids = AAZListArg( + options=["identity-object-ids"], help="The authenticated principal object IDs to match.", fmt=AAZListArgFormat( max_length=20, min_length=1, ), ) - match.foundry_caller_session_id = AAZListArg( - options=["foundry-caller-session-id"], - help="The Foundry session IDs to match.", + match.project_ids = AAZListArg( + options=["project-ids"], + help="The Foundry project resource IDs to match.", fmt=AAZListArgFormat( max_length=20, min_length=1, ), ) - match.foundry_project_id = AAZListArg( - options=["foundry-project-id"], - help="The Foundry project resource IDs to match.", + match.session_ids = AAZListArg( + options=["session-ids"], + help="The Foundry session IDs to match.", fmt=AAZListArgFormat( max_length=20, min_length=1, ), ) - foundry_caller_agent_id = cls._args_schema.rules.Element.match.foundry_caller_agent_id - foundry_caller_agent_id.Element = AAZStrArg( + agent_ids = cls._args_schema.rules.Element.match.agent_ids + agent_ids.Element = AAZStrArg( fmt=AAZStrArgFormat( min_length=1, ), ) - foundry_caller_identity_oid = cls._args_schema.rules.Element.match.foundry_caller_identity_oid - foundry_caller_identity_oid.Element = AAZStrArg( + identity_object_ids = cls._args_schema.rules.Element.match.identity_object_ids + identity_object_ids.Element = AAZStrArg( fmt=AAZStrArgFormat( min_length=1, ), ) - foundry_caller_session_id = cls._args_schema.rules.Element.match.foundry_caller_session_id - foundry_caller_session_id.Element = AAZStrArg( + project_ids = cls._args_schema.rules.Element.match.project_ids + project_ids.Element = AAZStrArg( fmt=AAZStrArgFormat( min_length=1, ), ) - foundry_project_id = cls._args_schema.rules.Element.match.foundry_project_id - foundry_project_id.Element = AAZStrArg( + session_ids = cls._args_schema.rules.Element.match.session_ids + session_ids.Element = AAZStrArg( fmt=AAZStrArgFormat( min_length=1, ), @@ -396,25 +396,26 @@ def content(self): match = _builder.get(".properties.rules[].match") if match is not None: - foundry_caller_agent_id = match.set_prop( - "foundry.caller.agent.id", AAZListType, ".foundry_caller_agent_id") - if foundry_caller_agent_id is not None: - foundry_caller_agent_id.set_elements(AAZStrType, ".") - - foundry_caller_identity_oid = match.set_prop( - "foundry.caller.identity.oid", AAZListType, ".foundry_caller_identity_oid") - if foundry_caller_identity_oid is not None: - foundry_caller_identity_oid.set_elements(AAZStrType, ".") - - foundry_caller_session_id = match.set_prop( - "foundry.caller.session.id", AAZListType, ".foundry_caller_session_id") - if foundry_caller_session_id is not None: - foundry_caller_session_id.set_elements(AAZStrType, ".") - - foundry_project_id = match.set_prop( - "foundry.project.id", AAZListType, ".foundry_project_id") - if foundry_project_id is not None: - foundry_project_id.set_elements(AAZStrType, ".") + match.set_prop("agentIds", AAZListType, ".agent_ids") + match.set_prop("identityObjectIds", AAZListType, ".identity_object_ids") + match.set_prop("projectIds", AAZListType, ".project_ids") + match.set_prop("sessionIds", AAZListType, ".session_ids") + + agent_ids = _builder.get(".properties.rules[].match.agentIds") + if agent_ids is not None: + agent_ids.set_elements(AAZStrType, ".") + + identity_object_ids = _builder.get(".properties.rules[].match.identityObjectIds") + if identity_object_ids is not None: + identity_object_ids.set_elements(AAZStrType, ".") + + project_ids = _builder.get(".properties.rules[].match.projectIds") + if project_ids is not None: + project_ids.set_elements(AAZStrType, ".") + + session_ids = _builder.get(".properties.rules[].match.sessionIds") + if session_ids is not None: + session_ids.set_elements(AAZStrType, ".") thresholds = _builder.get(".properties.rules[].thresholds") if thresholds is not None: @@ -506,22 +507,30 @@ def _build_schema_on_200_201(cls): ) match = cls._schema_on_200_201.properties.rules.Element.match - match["foundry.caller.agent.id"] = AAZListType() - match["foundry.caller.identity.oid"] = AAZListType() - match["foundry.caller.session.id"] = AAZListType() - match["foundry.project.id"] = AAZListType() + match.agent_ids = AAZListType( + serialized_name="agentIds", + ) + match.identity_object_ids = AAZListType( + serialized_name="identityObjectIds", + ) + match.project_ids = AAZListType( + serialized_name="projectIds", + ) + match.session_ids = AAZListType( + serialized_name="sessionIds", + ) - foundry_caller_agent_id = match["foundry.caller.agent.id"] - foundry_caller_agent_id.Element = AAZStrType() + agent_ids = cls._schema_on_200_201.properties.rules.Element.match.agent_ids + agent_ids.Element = AAZStrType() - foundry_caller_identity_oid = match["foundry.caller.identity.oid"] - foundry_caller_identity_oid.Element = AAZStrType() + identity_object_ids = cls._schema_on_200_201.properties.rules.Element.match.identity_object_ids + identity_object_ids.Element = AAZStrType() - foundry_caller_session_id = match["foundry.caller.session.id"] - foundry_caller_session_id.Element = AAZStrType() + project_ids = cls._schema_on_200_201.properties.rules.Element.match.project_ids + project_ids.Element = AAZStrType() - foundry_project_id = match["foundry.project.id"] - foundry_project_id.Element = AAZStrType() + session_ids = cls._schema_on_200_201.properties.rules.Element.match.session_ids + session_ids.Element = AAZStrType() thresholds = cls._schema_on_200_201.properties.rules.Element.thresholds thresholds.Element = AAZObjectType() diff --git a/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_list.py b/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_list.py index 92a90305ab0..03a0e836b27 100644 --- a/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_list.py +++ b/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_list.py @@ -229,22 +229,30 @@ def _build_schema_on_200(cls): ) match = cls._schema_on_200.value.Element.properties.rules.Element.match - match["foundry.caller.agent.id"] = AAZListType() - match["foundry.caller.identity.oid"] = AAZListType() - match["foundry.caller.session.id"] = AAZListType() - match["foundry.project.id"] = AAZListType() + match.agent_ids = AAZListType( + serialized_name="agentIds", + ) + match.identity_object_ids = AAZListType( + serialized_name="identityObjectIds", + ) + match.project_ids = AAZListType( + serialized_name="projectIds", + ) + match.session_ids = AAZListType( + serialized_name="sessionIds", + ) - foundry_caller_agent_id = match["foundry.caller.agent.id"] - foundry_caller_agent_id.Element = AAZStrType() + agent_ids = cls._schema_on_200.value.Element.properties.rules.Element.match.agent_ids + agent_ids.Element = AAZStrType() - foundry_caller_identity_oid = match["foundry.caller.identity.oid"] - foundry_caller_identity_oid.Element = AAZStrType() + identity_object_ids = cls._schema_on_200.value.Element.properties.rules.Element.match.identity_object_ids + identity_object_ids.Element = AAZStrType() - foundry_caller_session_id = match["foundry.caller.session.id"] - foundry_caller_session_id.Element = AAZStrType() + project_ids = cls._schema_on_200.value.Element.properties.rules.Element.match.project_ids + project_ids.Element = AAZStrType() - foundry_project_id = match["foundry.project.id"] - foundry_project_id.Element = AAZStrType() + session_ids = cls._schema_on_200.value.Element.properties.rules.Element.match.session_ids + session_ids.Element = AAZStrType() thresholds = cls._schema_on_200.value.Element.properties.rules.Element.thresholds thresholds.Element = AAZObjectType() diff --git a/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_show.py b/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_show.py index 39c908d1619..539e0ca945d 100644 --- a/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_show.py +++ b/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_show.py @@ -232,22 +232,30 @@ def _build_schema_on_200(cls): ) match = cls._schema_on_200.properties.rules.Element.match - match["foundry.caller.agent.id"] = AAZListType() - match["foundry.caller.identity.oid"] = AAZListType() - match["foundry.caller.session.id"] = AAZListType() - match["foundry.project.id"] = AAZListType() + match.agent_ids = AAZListType( + serialized_name="agentIds", + ) + match.identity_object_ids = AAZListType( + serialized_name="identityObjectIds", + ) + match.project_ids = AAZListType( + serialized_name="projectIds", + ) + match.session_ids = AAZListType( + serialized_name="sessionIds", + ) - foundry_caller_agent_id = match["foundry.caller.agent.id"] - foundry_caller_agent_id.Element = AAZStrType() + agent_ids = cls._schema_on_200.properties.rules.Element.match.agent_ids + agent_ids.Element = AAZStrType() - foundry_caller_identity_oid = match["foundry.caller.identity.oid"] - foundry_caller_identity_oid.Element = AAZStrType() + identity_object_ids = cls._schema_on_200.properties.rules.Element.match.identity_object_ids + identity_object_ids.Element = AAZStrType() - foundry_caller_session_id = match["foundry.caller.session.id"] - foundry_caller_session_id.Element = AAZStrType() + project_ids = cls._schema_on_200.properties.rules.Element.match.project_ids + project_ids.Element = AAZStrType() - foundry_project_id = match["foundry.project.id"] - foundry_project_id.Element = AAZStrType() + session_ids = cls._schema_on_200.properties.rules.Element.match.session_ids + session_ids.Element = AAZStrType() thresholds = cls._schema_on_200.properties.rules.Element.thresholds thresholds.Element = AAZObjectType() diff --git a/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_update.py b/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_update.py index fd70b65b497..8e7fbf09c56 100644 --- a/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_update.py +++ b/src/foundry-cost-control/azext_foundry_cost_control/aaz/latest/cognitiveservices/account/costcontrol/_update.py @@ -183,8 +183,8 @@ def _build_arguments_schema(cls, *args, **kwargs): ) match = cls._args_schema.rules.Element.match - match.foundry_caller_agent_id = AAZListArg( - options=["foundry-caller-agent-id"], + match.agent_ids = AAZListArg( + options=["agent-ids"], help="The stable Foundry agent IDs to match.", nullable=True, fmt=AAZListArgFormat( @@ -192,8 +192,8 @@ def _build_arguments_schema(cls, *args, **kwargs): min_length=1, ), ) - match.foundry_caller_identity_oid = AAZListArg( - options=["foundry-caller-identity-oid"], + match.identity_object_ids = AAZListArg( + options=["identity-object-ids"], help="The authenticated principal object IDs to match.", nullable=True, fmt=AAZListArgFormat( @@ -201,18 +201,18 @@ def _build_arguments_schema(cls, *args, **kwargs): min_length=1, ), ) - match.foundry_caller_session_id = AAZListArg( - options=["foundry-caller-session-id"], - help="The Foundry session IDs to match.", + match.project_ids = AAZListArg( + options=["project-ids"], + help="The Foundry project resource IDs to match.", nullable=True, fmt=AAZListArgFormat( max_length=20, min_length=1, ), ) - match.foundry_project_id = AAZListArg( - options=["foundry-project-id"], - help="The Foundry project resource IDs to match.", + match.session_ids = AAZListArg( + options=["session-ids"], + help="The Foundry session IDs to match.", nullable=True, fmt=AAZListArgFormat( max_length=20, @@ -220,32 +220,32 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) - foundry_caller_agent_id = cls._args_schema.rules.Element.match.foundry_caller_agent_id - foundry_caller_agent_id.Element = AAZStrArg( + agent_ids = cls._args_schema.rules.Element.match.agent_ids + agent_ids.Element = AAZStrArg( nullable=True, fmt=AAZStrArgFormat( min_length=1, ), ) - foundry_caller_identity_oid = cls._args_schema.rules.Element.match.foundry_caller_identity_oid - foundry_caller_identity_oid.Element = AAZStrArg( + identity_object_ids = cls._args_schema.rules.Element.match.identity_object_ids + identity_object_ids.Element = AAZStrArg( nullable=True, fmt=AAZStrArgFormat( min_length=1, ), ) - foundry_caller_session_id = cls._args_schema.rules.Element.match.foundry_caller_session_id - foundry_caller_session_id.Element = AAZStrArg( + project_ids = cls._args_schema.rules.Element.match.project_ids + project_ids.Element = AAZStrArg( nullable=True, fmt=AAZStrArgFormat( min_length=1, ), ) - foundry_project_id = cls._args_schema.rules.Element.match.foundry_project_id - foundry_project_id.Element = AAZStrArg( + session_ids = cls._args_schema.rules.Element.match.session_ids + session_ids.Element = AAZStrArg( nullable=True, fmt=AAZStrArgFormat( min_length=1, @@ -453,22 +453,30 @@ def _build_schema_on_200(cls): ) match = cls._schema_on_200.properties.rules.Element.match - match["foundry.caller.agent.id"] = AAZListType() - match["foundry.caller.identity.oid"] = AAZListType() - match["foundry.caller.session.id"] = AAZListType() - match["foundry.project.id"] = AAZListType() + match.agent_ids = AAZListType( + serialized_name="agentIds", + ) + match.identity_object_ids = AAZListType( + serialized_name="identityObjectIds", + ) + match.project_ids = AAZListType( + serialized_name="projectIds", + ) + match.session_ids = AAZListType( + serialized_name="sessionIds", + ) - foundry_caller_agent_id = match["foundry.caller.agent.id"] - foundry_caller_agent_id.Element = AAZStrType() + agent_ids = cls._schema_on_200.properties.rules.Element.match.agent_ids + agent_ids.Element = AAZStrType() - foundry_caller_identity_oid = match["foundry.caller.identity.oid"] - foundry_caller_identity_oid.Element = AAZStrType() + identity_object_ids = cls._schema_on_200.properties.rules.Element.match.identity_object_ids + identity_object_ids.Element = AAZStrType() - foundry_caller_session_id = match["foundry.caller.session.id"] - foundry_caller_session_id.Element = AAZStrType() + project_ids = cls._schema_on_200.properties.rules.Element.match.project_ids + project_ids.Element = AAZStrType() - foundry_project_id = match["foundry.project.id"] - foundry_project_id.Element = AAZStrType() + session_ids = cls._schema_on_200.properties.rules.Element.match.session_ids + session_ids.Element = AAZStrType() thresholds = cls._schema_on_200.properties.rules.Element.thresholds thresholds.Element = AAZObjectType() @@ -667,22 +675,30 @@ def _build_schema_on_200_201(cls): ) match = cls._schema_on_200_201.properties.rules.Element.match - match["foundry.caller.agent.id"] = AAZListType() - match["foundry.caller.identity.oid"] = AAZListType() - match["foundry.caller.session.id"] = AAZListType() - match["foundry.project.id"] = AAZListType() + match.agent_ids = AAZListType( + serialized_name="agentIds", + ) + match.identity_object_ids = AAZListType( + serialized_name="identityObjectIds", + ) + match.project_ids = AAZListType( + serialized_name="projectIds", + ) + match.session_ids = AAZListType( + serialized_name="sessionIds", + ) - foundry_caller_agent_id = match["foundry.caller.agent.id"] - foundry_caller_agent_id.Element = AAZStrType() + agent_ids = cls._schema_on_200_201.properties.rules.Element.match.agent_ids + agent_ids.Element = AAZStrType() - foundry_caller_identity_oid = match["foundry.caller.identity.oid"] - foundry_caller_identity_oid.Element = AAZStrType() + identity_object_ids = cls._schema_on_200_201.properties.rules.Element.match.identity_object_ids + identity_object_ids.Element = AAZStrType() - foundry_caller_session_id = match["foundry.caller.session.id"] - foundry_caller_session_id.Element = AAZStrType() + project_ids = cls._schema_on_200_201.properties.rules.Element.match.project_ids + project_ids.Element = AAZStrType() - foundry_project_id = match["foundry.project.id"] - foundry_project_id.Element = AAZStrType() + session_ids = cls._schema_on_200_201.properties.rules.Element.match.session_ids + session_ids.Element = AAZStrType() thresholds = cls._schema_on_200_201.properties.rules.Element.thresholds thresholds.Element = AAZObjectType() @@ -762,25 +778,26 @@ def _update_instance(self, instance): match = _builder.get(".properties.rules[].match") if match is not None: - foundry_caller_agent_id = match.set_prop( - "foundry.caller.agent.id", AAZListType, ".foundry_caller_agent_id") - if foundry_caller_agent_id is not None: - foundry_caller_agent_id.set_elements(AAZStrType, ".") - - foundry_caller_identity_oid = match.set_prop( - "foundry.caller.identity.oid", AAZListType, ".foundry_caller_identity_oid") - if foundry_caller_identity_oid is not None: - foundry_caller_identity_oid.set_elements(AAZStrType, ".") - - foundry_caller_session_id = match.set_prop( - "foundry.caller.session.id", AAZListType, ".foundry_caller_session_id") - if foundry_caller_session_id is not None: - foundry_caller_session_id.set_elements(AAZStrType, ".") - - foundry_project_id = match.set_prop( - "foundry.project.id", AAZListType, ".foundry_project_id") - if foundry_project_id is not None: - foundry_project_id.set_elements(AAZStrType, ".") + match.set_prop("agentIds", AAZListType, ".agent_ids") + match.set_prop("identityObjectIds", AAZListType, ".identity_object_ids") + match.set_prop("projectIds", AAZListType, ".project_ids") + match.set_prop("sessionIds", AAZListType, ".session_ids") + + agent_ids = _builder.get(".properties.rules[].match.agentIds") + if agent_ids is not None: + agent_ids.set_elements(AAZStrType, ".") + + identity_object_ids = _builder.get(".properties.rules[].match.identityObjectIds") + if identity_object_ids is not None: + identity_object_ids.set_elements(AAZStrType, ".") + + project_ids = _builder.get(".properties.rules[].match.projectIds") + if project_ids is not None: + project_ids.set_elements(AAZStrType, ".") + + session_ids = _builder.get(".properties.rules[].match.sessionIds") + if session_ids is not None: + session_ids.set_elements(AAZStrType, ".") thresholds = _builder.get(".properties.rules[].thresholds") if thresholds is not None: From b68f75f638cff869c1fa2542aa3acda719330fd9 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 30 Sep 2026 13:16:10 -0700 Subject: [PATCH 2/4] Update release history and set version to beta3 --- src/foundry-cost-control/HISTORY.rst | 4 ++++ src/foundry-cost-control/setup.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/foundry-cost-control/HISTORY.rst b/src/foundry-cost-control/HISTORY.rst index 31da49553cf..faa37b07813 100644 --- a/src/foundry-cost-control/HISTORY.rst +++ b/src/foundry-cost-control/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +1.0.0b3 +++++++ +* Update cost-control rule matching to use the ``agentIds``, ``identityObjectIds``, ``projectIds``, and ``sessionIds`` properties and corresponding CLI options. + 1.0.0b2 ++++++ * Override ``cognitiveservices account show`` to use API version ``2026-09-15-preview`` and return cost-control properties. diff --git a/src/foundry-cost-control/setup.py b/src/foundry-cost-control/setup.py index d83b3c6ef1f..2fab52e6c0f 100644 --- a/src/foundry-cost-control/setup.py +++ b/src/foundry-cost-control/setup.py @@ -9,7 +9,7 @@ # HISTORY.rst entry. -VERSION = '1.0.0b2' +VERSION = '1.0.0b3' # The full list of classifiers is available at # https://pypi.python.org/pypi?%3Aaction=list_classifiers From 0b58b117dc7e4e778f180a795bfaabad1fbaa94a Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 30 Sep 2026 13:26:29 -0700 Subject: [PATCH 3/4] Fix recording --- .../tests/latest/cost-control-rules-1.json | 2 +- .../tests/latest/cost-control-rules-2.json | 2 +- .../recordings/test_foundry_cost_control.yaml | 22 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/cost-control-rules-1.json b/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/cost-control-rules-1.json index 4a0d3447bf0..a1126ad1872 100644 --- a/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/cost-control-rules-1.json +++ b/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/cost-control-rules-1.json @@ -11,7 +11,7 @@ "period": "month", "recurring": true, "match": { - "foundry-caller-agent-id": [ + "agentIds": [ "agent-123" ] }, diff --git a/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/cost-control-rules-2.json b/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/cost-control-rules-2.json index 658ce0e5562..c2d92f2d68e 100644 --- a/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/cost-control-rules-2.json +++ b/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/cost-control-rules-2.json @@ -11,7 +11,7 @@ "period": "month", "recurring": true, "match": { - "foundry-project-id": [ + "projectIds": [ "project-456" ] }, diff --git a/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/recordings/test_foundry_cost_control.yaml b/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/recordings/test_foundry_cost_control.yaml index 63d5bb24620..8b57f90a3c5 100644 --- a/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/recordings/test_foundry_cost_control.yaml +++ b/src/foundry-cost-control/azext_foundry_cost_control/tests/latest/recordings/test_foundry_cost_control.yaml @@ -311,7 +311,7 @@ interactions: message: OK - request: body: '{"properties": {"displayName": "first display name", "rules": [{"amount": - 200.0, "counterKey": [{"type": "agent"}], "match": {"foundry.caller.agent.id": + 200.0, "counterKey": [{"type": "agent"}], "match": {"agentIds": ["agent-123"]}, "name": "per-agent-monthly", "period": "month", "recurring": true, "thresholds": [{"action": "alert", "type": "percentage", "value": 80.0}, {"action": "audit", "type": "absolute", "value": 0.0}], "unit": "usd"}]}}' @@ -337,7 +337,7 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-cli-cost-control-test-rg-000001/providers/Microsoft.CognitiveServices/accounts/test-account-000002/costControls/test-1","type":"Microsoft.CognitiveServices/accounts/costControls","name":"test-1","properties":{"displayName":"first - display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"foundry.caller.agent.id":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:58.1733277Z"},"etag":"\"8e7a18bc-826a-459c-9f83-b2e149d58590\""}' + display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"agentIds":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:58.1733277Z"},"etag":"\"8e7a18bc-826a-459c-9f83-b2e149d58590\""}' headers: cache-control: - no-cache @@ -374,7 +374,7 @@ interactions: message: Created - request: body: '{"properties": {"displayName": "second display name", "rules": [{"amount": - 500.0, "counterKey": [{"type": "project"}], "match": {"foundry.project.id": + 500.0, "counterKey": [{"type": "project"}], "match": {"projectIds": ["project-456"]}, "name": "per-project-monthly", "period": "month", "recurring": true, "thresholds": [{"action": "alert", "type": "percentage", "value": 90.0}, {"action": "audit", "type": "absolute", "value": 0.0}], "unit": "usd"}]}}' @@ -400,7 +400,7 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-cli-cost-control-test-rg-000001/providers/Microsoft.CognitiveServices/accounts/test-account-000002/costControls/test-2","type":"Microsoft.CognitiveServices/accounts/costControls","name":"test-2","properties":{"displayName":"second - display name","rules":[{"name":"per-project-monthly","counterKey":[{"type":"project"}],"unit":"usd","amount":500.0,"period":"month","recurring":true,"match":{"foundry.project.id":["project-456"]},"thresholds":[{"type":"percentage","value":90.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:59.3413717Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:59.3413717Z"},"etag":"\"1315adf4-6f52-4f57-95a7-e02b14c0463f\""}' + display name","rules":[{"name":"per-project-monthly","counterKey":[{"type":"project"}],"unit":"usd","amount":500.0,"period":"month","recurring":true,"match":{"projectIds":["project-456"]},"thresholds":[{"type":"percentage","value":90.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:59.3413717Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:59.3413717Z"},"etag":"\"1315adf4-6f52-4f57-95a7-e02b14c0463f\""}' headers: cache-control: - no-cache @@ -1041,8 +1041,8 @@ interactions: response: body: string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-cli-cost-control-test-rg-000001/providers/Microsoft.CognitiveServices/accounts/test-account-000002/costControls/test-1","type":"Microsoft.CognitiveServices/accounts/costControls","name":"test-1","properties":{"displayName":"first - display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"foundry.caller.agent.id":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:58.1733277Z"},"etag":"\"8e7a18bc-826a-459c-9f83-b2e149d58590\""},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-cli-cost-control-test-rg-000001/providers/Microsoft.CognitiveServices/accounts/test-account-000002/costControls/test-2","type":"Microsoft.CognitiveServices/accounts/costControls","name":"test-2","properties":{"displayName":"second - display name","rules":[{"name":"per-project-monthly","counterKey":[{"type":"project"}],"unit":"usd","amount":500.0,"period":"month","recurring":true,"match":{"foundry.project.id":["project-456"]},"thresholds":[{"type":"percentage","value":90.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:59.3413717Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:59.3413717Z"},"etag":"\"1315adf4-6f52-4f57-95a7-e02b14c0463f\""}]}' + display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"agentIds":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:58.1733277Z"},"etag":"\"8e7a18bc-826a-459c-9f83-b2e149d58590\""},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-cli-cost-control-test-rg-000001/providers/Microsoft.CognitiveServices/accounts/test-account-000002/costControls/test-2","type":"Microsoft.CognitiveServices/accounts/costControls","name":"test-2","properties":{"displayName":"second + display name","rules":[{"name":"per-project-monthly","counterKey":[{"type":"project"}],"unit":"usd","amount":500.0,"period":"month","recurring":true,"match":{"projectIds":["project-456"]},"thresholds":[{"type":"percentage","value":90.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:59.3413717Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:59.3413717Z"},"etag":"\"1315adf4-6f52-4f57-95a7-e02b14c0463f\""}]}' headers: cache-control: - no-cache @@ -1093,7 +1093,7 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-cli-cost-control-test-rg-000001/providers/Microsoft.CognitiveServices/accounts/test-account-000002/costControls/test-1","type":"Microsoft.CognitiveServices/accounts/costControls","name":"test-1","properties":{"displayName":"first - display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"foundry.caller.agent.id":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:58.1733277Z"},"etag":"\"8e7a18bc-826a-459c-9f83-b2e149d58590\""}' + display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"agentIds":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:58.1733277Z"},"etag":"\"8e7a18bc-826a-459c-9f83-b2e149d58590\""}' headers: cache-control: - no-cache @@ -1146,7 +1146,7 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-cli-cost-control-test-rg-000001/providers/Microsoft.CognitiveServices/accounts/test-account-000002/costControls/test-1","type":"Microsoft.CognitiveServices/accounts/costControls","name":"test-1","properties":{"displayName":"first - display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"foundry.caller.agent.id":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:58.1733277Z"},"etag":"\"8e7a18bc-826a-459c-9f83-b2e149d58590\""}' + display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"agentIds":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:33:58.1733277Z"},"etag":"\"8e7a18bc-826a-459c-9f83-b2e149d58590\""}' headers: cache-control: - no-cache @@ -1181,7 +1181,7 @@ interactions: message: OK - request: body: '{"properties": {"displayName": "updated first display name", "rules": [{"amount": - 200.0, "counterKey": [{"type": "agent"}], "match": {"foundry.caller.agent.id": + 200.0, "counterKey": [{"type": "agent"}], "match": {"agentIds": ["agent-123"]}, "name": "per-agent-monthly", "period": "month", "recurring": true, "thresholds": [{"action": "alert", "type": "percentage", "value": 80.0}, {"action": "audit", "type": "absolute", "value": 0.0}], "unit": "usd"}]}}' @@ -1207,7 +1207,7 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-cli-cost-control-test-rg-000001/providers/Microsoft.CognitiveServices/accounts/test-account-000002/costControls/test-1","type":"Microsoft.CognitiveServices/accounts/costControls","name":"test-1","properties":{"displayName":"updated - first display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"foundry.caller.agent.id":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:34:43.3423941Z"},"etag":"\"c51ed070-99a2-4468-be5c-4975e3c51a39\""}' + first display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"agentIds":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:34:43.3423941Z"},"etag":"\"c51ed070-99a2-4468-be5c-4975e3c51a39\""}' headers: cache-control: - no-cache @@ -1262,7 +1262,7 @@ interactions: response: body: string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/az-cli-cost-control-test-rg-000001/providers/Microsoft.CognitiveServices/accounts/test-account-000002/costControls/test-1","type":"Microsoft.CognitiveServices/accounts/costControls","name":"test-1","properties":{"displayName":"updated - first display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"foundry.caller.agent.id":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:34:43.3423941Z"},"etag":"\"c51ed070-99a2-4468-be5c-4975e3c51a39\""}' + first display name","rules":[{"name":"per-agent-monthly","counterKey":[{"type":"agent"}],"unit":"usd","amount":200.0,"period":"month","recurring":true,"match":{"agentIds":["agent-123"]},"thresholds":[{"type":"percentage","value":80.0,"action":"alert"},{"type":"absolute","value":0.0,"action":"audit"}]}]},"systemData":{"createdBy":"test@example.com","createdByType":"User","createdAt":"2026-09-28T21:33:58.1733277Z","lastModifiedBy":"test@example.com","lastModifiedByType":"User","lastModifiedAt":"2026-09-28T21:34:43.3423941Z"},"etag":"\"c51ed070-99a2-4468-be5c-4975e3c51a39\""}' headers: cache-control: - no-cache From f11efa6df34b57c2b5b983085ad8bdd1a3fb0ee5 Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 30 Sep 2026 13:28:49 -0700 Subject: [PATCH 4/4] Delete Post --- src/foundry-cost-control/PostEmitter.ps1 | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/foundry-cost-control/PostEmitter.ps1 diff --git a/src/foundry-cost-control/PostEmitter.ps1 b/src/foundry-cost-control/PostEmitter.ps1 deleted file mode 100644 index 206d4372c92..00000000000 --- a/src/foundry-cost-control/PostEmitter.ps1 +++ /dev/null @@ -1,23 +0,0 @@ -# -# Run this script after re-emitting the code: -# powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\PostEmitter.ps1 -# - -# Change 1: -# I did manual edits to README.md and setup.py files. Make sure you restore -# this version after you re-emit - -& git -C $PSScriptRoot restore -- README.md -if ($LASTEXITCODE -ne 0) { - throw "Failed to restore README.md after CLI emission." -} - -& git -C $PSScriptRoot restore -- setup.py -if ($LASTEXITCODE -ne 0) { - throw "Failed to restore setup.py after CLI emission." -} - -# Change 2: -# Use CoPilot to fix an emitter bug (?). Use this prompt: -# Run "cls & azdev test foundry-cost-control --live --debug" and fix the resulting error. A similar fix was made in the past, so you can look at this commit for reference: https://github.com/Azure/azure-cli-extensions/pull/10298/changes/d981f14597cdcd118c3ab7b17264057944496a97 -#