Skip to content
Draft
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/foundry-cost-control/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
23 changes: 0 additions & 23 deletions src/foundry-cost-control/PostEmitter.ps1

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading
Loading