Skip to content
Merged
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
20 changes: 16 additions & 4 deletions nuon/api/installs/add_install_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def sync_detailed(
) -> Response[AppInstall | StderrErrResponse]:
"""add labels to an install

Merge the provided labels into the install's existing labels. Existing keys are overwritten.
Merge the provided labels into the install's existing labels. Existing keys are overwritten. A value
using the .nuon interpolation syntax becomes a dynamic label: the template is stored and its
rendered value is re-materialized whenever install state changes. Keys managed by the app config's
default_labels cannot be changed here.

Args:
install_id (str):
Expand Down Expand Up @@ -126,7 +129,10 @@ def sync(
) -> AppInstall | StderrErrResponse | None:
"""add labels to an install

Merge the provided labels into the install's existing labels. Existing keys are overwritten.
Merge the provided labels into the install's existing labels. Existing keys are overwritten. A value
using the .nuon interpolation syntax becomes a dynamic label: the template is stored and its
rendered value is re-materialized whenever install state changes. Keys managed by the app config's
default_labels cannot be changed here.

Args:
install_id (str):
Expand Down Expand Up @@ -155,7 +161,10 @@ async def asyncio_detailed(
) -> Response[AppInstall | StderrErrResponse]:
"""add labels to an install

Merge the provided labels into the install's existing labels. Existing keys are overwritten.
Merge the provided labels into the install's existing labels. Existing keys are overwritten. A value
using the .nuon interpolation syntax becomes a dynamic label: the template is stored and its
rendered value is re-materialized whenever install state changes. Keys managed by the app config's
default_labels cannot be changed here.

Args:
install_id (str):
Expand Down Expand Up @@ -187,7 +196,10 @@ async def asyncio(
) -> AppInstall | StderrErrResponse | None:
"""add labels to an install

Merge the provided labels into the install's existing labels. Existing keys are overwritten.
Merge the provided labels into the install's existing labels. Existing keys are overwritten. A value
using the .nuon interpolation syntax becomes a dynamic label: the template is stored and its
rendered value is re-materialized whenever install state changes. Keys managed by the app config's
default_labels cannot be changed here.

Args:
install_id (str):
Expand Down
12 changes: 8 additions & 4 deletions nuon/api/installs/remove_install_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def sync_detailed(
) -> Response[AppInstall | StderrErrResponse]:
"""remove labels from an install

Remove the specified label keys from the install.
Remove the specified label keys from the install. Removing a dynamic label's key also removes its
template. Keys managed by the app config's default_labels cannot be removed here.

Args:
install_id (str):
Expand Down Expand Up @@ -126,7 +127,8 @@ def sync(
) -> AppInstall | StderrErrResponse | None:
"""remove labels from an install

Remove the specified label keys from the install.
Remove the specified label keys from the install. Removing a dynamic label's key also removes its
template. Keys managed by the app config's default_labels cannot be removed here.

Args:
install_id (str):
Expand Down Expand Up @@ -155,7 +157,8 @@ async def asyncio_detailed(
) -> Response[AppInstall | StderrErrResponse]:
"""remove labels from an install

Remove the specified label keys from the install.
Remove the specified label keys from the install. Removing a dynamic label's key also removes its
template. Keys managed by the app config's default_labels cannot be removed here.

Args:
install_id (str):
Expand Down Expand Up @@ -187,7 +190,8 @@ async def asyncio(
) -> AppInstall | StderrErrResponse | None:
"""remove labels from an install

Remove the specified label keys from the install.
Remove the specified label keys from the install. Removing a dynamic label's key also removes its
template. Keys managed by the app config's default_labels cannot be removed here.

Args:
install_id (str):
Expand Down
6 changes: 6 additions & 0 deletions nuon/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from .app_app_config import AppAppConfig
from .app_app_config_status import AppAppConfigStatus
from .app_app_config_version import AppAppConfigVersion
from .app_app_default_labels import AppAppDefaultLabels
from .app_app_input import AppAppInput
from .app_app_input_config import AppAppInputConfig
from .app_app_input_group import AppAppInputGroup
Expand Down Expand Up @@ -110,6 +111,7 @@
from .app_install_app_branch_connection import AppInstallAppBranchConnection
from .app_install_app_config_version import AppInstallAppConfigVersion
from .app_install_app_config_version_metadata import AppInstallAppConfigVersionMetadata
from .app_install_app_default_labels import AppInstallAppDefaultLabels
from .app_install_approval_option import AppInstallApprovalOption
from .app_install_audit_log import AppInstallAuditLog
from .app_install_cloud_platform_metadata import AppInstallCloudPlatformMetadata
Expand Down Expand Up @@ -138,6 +140,7 @@
from .app_install_inputs import AppInstallInputs
from .app_install_inputs_redacted_values import AppInstallInputsRedactedValues
from .app_install_inputs_values import AppInstallInputsValues
from .app_install_label_templates import AppInstallLabelTemplates
from .app_install_lifecycle_phase import AppInstallLifecyclePhase
from .app_install_links import AppInstallLinks
from .app_install_metadata import AppInstallMetadata
Expand Down Expand Up @@ -837,6 +840,7 @@
"AppAppConfig",
"AppAppConfigStatus",
"AppAppConfigVersion",
"AppAppDefaultLabels",
"AppAppInput",
"AppAppInputConfig",
"AppAppInputGroup",
Expand Down Expand Up @@ -925,6 +929,7 @@
"AppInstallAppBranchConnection",
"AppInstallAppConfigVersion",
"AppInstallAppConfigVersionMetadata",
"AppInstallAppDefaultLabels",
"AppInstallApprovalOption",
"AppInstallAuditLog",
"AppInstallCloudPlatformMetadata",
Expand Down Expand Up @@ -953,6 +958,7 @@
"AppInstallInputs",
"AppInstallInputsRedactedValues",
"AppInstallInputsValues",
"AppInstallLabelTemplates",
"AppInstallLifecyclePhase",
"AppInstallLinks",
"AppInstallMetadata",
Expand Down
20 changes: 20 additions & 0 deletions nuon/models/app_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

if TYPE_CHECKING:
from ..models.app_app_config import AppAppConfig
from ..models.app_app_default_labels import AppAppDefaultLabels
from ..models.app_app_input_config import AppAppInputConfig
from ..models.app_app_label_colors import AppAppLabelColors
from ..models.app_app_links import AppAppLinks
Expand All @@ -34,6 +35,9 @@ class AppApp:
config_repo (str | Unset):
created_at (str | Unset):
created_by_id (str | Unset):
default_labels (AppAppDefaultLabels | Unset): DefaultLabels are applied to every install of the app and can only
be
changed via app config sync — install label endpoints reject these keys.
description (str | Unset):
display_name (str | Unset):
id (str | Unset):
Expand Down Expand Up @@ -61,6 +65,7 @@ class AppApp:
config_repo: str | Unset = UNSET
created_at: str | Unset = UNSET
created_by_id: str | Unset = UNSET
default_labels: AppAppDefaultLabels | Unset = UNSET
description: str | Unset = UNSET
display_name: str | Unset = UNSET
id: str | Unset = UNSET
Expand Down Expand Up @@ -101,6 +106,10 @@ def to_dict(self) -> dict[str, Any]:

created_by_id = self.created_by_id

default_labels: dict[str, Any] | Unset = UNSET
if not isinstance(self.default_labels, Unset):
default_labels = self.default_labels.to_dict()

description = self.description

display_name = self.display_name
Expand Down Expand Up @@ -170,6 +179,8 @@ def to_dict(self) -> dict[str, Any]:
field_dict["created_at"] = created_at
if created_by_id is not UNSET:
field_dict["created_by_id"] = created_by_id
if default_labels is not UNSET:
field_dict["default_labels"] = default_labels
if description is not UNSET:
field_dict["description"] = description
if display_name is not UNSET:
Expand Down Expand Up @@ -212,6 +223,7 @@ def to_dict(self) -> dict[str, Any]:
@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
from ..models.app_app_config import AppAppConfig
from ..models.app_app_default_labels import AppAppDefaultLabels
from ..models.app_app_input_config import AppAppInputConfig
from ..models.app_app_label_colors import AppAppLabelColors
from ..models.app_app_links import AppAppLinks
Expand Down Expand Up @@ -243,6 +255,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:

created_by_id = d.pop("created_by_id", UNSET)

_default_labels = d.pop("default_labels", UNSET)
default_labels: AppAppDefaultLabels | Unset
if isinstance(_default_labels, Unset):
default_labels = UNSET
else:
default_labels = AppAppDefaultLabels.from_dict(_default_labels)

description = d.pop("description", UNSET)

display_name = d.pop("display_name", UNSET)
Expand Down Expand Up @@ -327,6 +346,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
config_repo=config_repo,
created_at=created_at,
created_by_id=created_by_id,
default_labels=default_labels,
description=description,
display_name=display_name,
id=id,
Expand Down
50 changes: 50 additions & 0 deletions nuon/models/app_app_default_labels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from __future__ import annotations

from collections.abc import Mapping
from typing import Any, TypeVar

from attrs import define as _attrs_define
from attrs import field as _attrs_field

T = TypeVar("T", bound="AppAppDefaultLabels")


@_attrs_define
class AppAppDefaultLabels:
"""DefaultLabels are applied to every install of the app and can only be
changed via app config sync — install label endpoints reject these keys.

"""

additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)

return field_dict

@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
d = dict(src_dict)
app_app_default_labels = cls()

app_app_default_labels.additional_properties = d
return app_app_default_labels

@property
def additional_keys(self) -> list[str]:
return list(self.additional_properties.keys())

def __getitem__(self, key: str) -> str:
return self.additional_properties[key]

def __setitem__(self, key: str, value: str) -> None:
self.additional_properties[key] = value

def __delitem__(self, key: str) -> None:
del self.additional_properties[key]

def __contains__(self, key: str) -> bool:
return key in self.additional_properties
12 changes: 12 additions & 0 deletions nuon/models/app_azure_stack_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ class AppAzureStackOutputs:
resource_group_id (str | Unset):
resource_group_location (str | Unset):
resource_group_name (str | Unset):
runner_identity_principal_id (str | Unset): Principal ID of the runner VMSS's system-assigned identity. Secret
sync and
image sync run as this identity, not a per-operation one, so sandboxes need
it to grant cluster access.
subscription_id (str | Unset):
subscription_tenant_id (str | Unset):
"""
Expand All @@ -61,6 +65,7 @@ class AppAzureStackOutputs:
resource_group_id: str | Unset = UNSET
resource_group_location: str | Unset = UNSET
resource_group_name: str | Unset = UNSET
runner_identity_principal_id: str | Unset = UNSET
subscription_id: str | Unset = UNSET
subscription_tenant_id: str | Unset = UNSET
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
Expand Down Expand Up @@ -114,6 +119,8 @@ def to_dict(self) -> dict[str, Any]:

resource_group_name = self.resource_group_name

runner_identity_principal_id = self.runner_identity_principal_id

subscription_id = self.subscription_id

subscription_tenant_id = self.subscription_tenant_id
Expand Down Expand Up @@ -155,6 +162,8 @@ def to_dict(self) -> dict[str, Any]:
field_dict["resource_group_location"] = resource_group_location
if resource_group_name is not UNSET:
field_dict["resource_group_name"] = resource_group_name
if runner_identity_principal_id is not UNSET:
field_dict["runner_identity_principal_id"] = runner_identity_principal_id
if subscription_id is not UNSET:
field_dict["subscription_id"] = subscription_id
if subscription_tenant_id is not UNSET:
Expand Down Expand Up @@ -226,6 +235,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:

resource_group_name = d.pop("resource_group_name", UNSET)

runner_identity_principal_id = d.pop("runner_identity_principal_id", UNSET)

subscription_id = d.pop("subscription_id", UNSET)

subscription_tenant_id = d.pop("subscription_tenant_id", UNSET)
Expand All @@ -248,6 +259,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
resource_group_id=resource_group_id,
resource_group_location=resource_group_location,
resource_group_name=resource_group_name,
runner_identity_principal_id=runner_identity_principal_id,
subscription_id=subscription_id,
subscription_tenant_id=subscription_tenant_id,
)
Expand Down
Loading
Loading