query stringlengths 9 9.05k | document stringlengths 10 222k | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Internal function to obtain the value of enable_local_accounts. This function supports the option of enable_validation. When enabled, if both disable_local_accounts and enable_local_accounts are specified, raise a MutuallyExclusiveArgumentError. | def _get_enable_local_accounts(self, enable_validation: bool = False) -> bool:
# read the original value passed by the command
enable_local_accounts = self.raw_param.get("enable_local_accounts")
# We do not support this option in create mode, therefore we do not read the value from `mc`.
... | [
"def get_enable_local_accounts(self) -> bool:\n return self._get_enable_local_accounts(enable_validation=True)",
"def _get_disable_local_accounts(self, enable_validation: bool = False) -> bool:\n # read the original value passed by the command\n disable_local_accounts = self.raw_param.get(\"d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the value of enable_local_accounts. This function will verify the parameter by default. If both disable_local_accounts and enable_local_accounts are specified, raise a MutuallyExclusiveArgumentError. | def get_enable_local_accounts(self) -> bool:
return self._get_enable_local_accounts(enable_validation=True) | [
"def _get_enable_local_accounts(self, enable_validation: bool = False) -> bool:\n # read the original value passed by the command\n enable_local_accounts = self.raw_param.get(\"enable_local_accounts\")\n # We do not support this option in create mode, therefore we do not read the value from `mc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the value of edge_zone. | def get_edge_zone(self) -> Union[str, None]:
# read the original value passed by the command
edge_zone = self.raw_param.get("edge_zone")
# try to read the property value corresponding to the parameter from the `mc` object
# Backward Compatibility: We also support api version v2020.11.01 ... | [
"def edge_zone(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"edge_zone\")",
"def get_zone(self, zone_no):\n return self.coordinate3d_combined[zone_no]",
"def zone_sensor(self) -> Entity:\n return self._zone_sensor",
"def ozone(self) -> float:\n return self._attr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the value of node_resource_group. | def get_node_resource_group(self) -> Union[str, None]:
# read the original value passed by the command
node_resource_group = self.raw_param.get("node_resource_group")
# try to read the property value corresponding to the parameter from the `mc` object
if self.mc and self.mc.node_resource... | [
"def node_resource_group(self) -> Optional[pulumi.Input[str]]:\n return pulumi.get(self, \"node_resource_group\")",
"def node_resource_group(self) -> pulumi.Output[str]:\n return pulumi.get(self, \"node_resource_group\")",
"def resource_group(self) -> pulumi.Output[str]:\n return pulumi.get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the value of kubernetes_support_plan. | def get_k8s_support_plan(self) -> Union[str, None]:
# default to None
support_plan = None
# try to read the property value corresponding to the parameter from the `mc` object
if self.mc and hasattr(self.mc, "support_plan") and self.mc.support_plan is not None:
support_plan = ... | [
"def plan(self) -> str:\n return pulumi.get(self, \"plan\")",
"def get_plan(self):\n sub = self.get_subscription()\n return sub.plan",
"def pricing_plan(self) -> str:\n return pulumi.get(self, \"pricing_plan\")",
"def pricing_plan(self) -> Optional[pulumi.Input[str]]:\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the value of yes. | def get_yes(self) -> bool:
# read the original value passed by the command
yes = self.raw_param.get("yes")
# this parameter does not need dynamic completion
# this parameter does not need validation
return yes | [
"def get_yesno(yesno):\n return 'yes' if yesno == 1 else 'no'",
"def yesno(val):\n if val:\n return 'yes'\n else:\n return 'no'",
"def get_true_label(self):\n return gettext_lazy('Yes')",
"def isYes(response):\n return (\"y\" in response) or (\"Y\" in response)",
"def Format... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the value of no_wait. | def get_no_wait(self) -> bool:
# read the original value passed by the command
no_wait = self.raw_param.get("no_wait")
# this parameter does not need dynamic completion
# this parameter does not need validation
return no_wait | [
"def __get_wait(self, poz):\n\t\ttry:\n\t\t\tkodon = self.seq[poz]\n\t\texcept IndexError:\n\t\t\twait = 0\t\t\t\n\t\telse:\n\t\t\tif trnadict.has_key(kodon):\n\t\t\t\twait = int(round(trnadict[kodon], 0))\n\t\t\telse:\n\t\t\t\twait = 0\n\t\treturn wait",
"def use_wait(self):\n return self._use_wait",
"d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the value of aks_custom_headers. | def get_aks_custom_headers(self) -> Dict[str, str]:
# read the original value passed by the command
aks_custom_headers = self.raw_param.get("aks_custom_headers")
# normalize user-provided header, extract key-value pairs with comma as separator
# used to enable (preview) features through ... | [
"def custom_headers(self):\n return self._custom_headers",
"def _get_headers(response):\n return response.headers",
"def GetHeadersIn(self):\n return self.__GetDumpValue('dumpHeadersIn')",
"def custom_claims(self):\n claims = self._data.get('customAttributes')\n if claims:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal function to obtain the value of enable_azure_monitor_metrics. This function supports the option of enable_validation. When enabled, if both enable_azure_monitor_metrics and disable_azure_monitor_metrics are specified, raise a MutuallyExclusiveArgumentError. | def _get_enable_azure_monitor_metrics(self, enable_validation: bool = False) -> bool:
# print("_get_enable_azure_monitor_metrics being called...")
# Read the original value passed by the command.
enable_azure_monitor_metrics = self.raw_param.get("enable_azure_monitor_metrics")
# In creat... | [
"def get_enable_azure_monitor_metrics(self) -> bool:\n return self._get_enable_azure_monitor_metrics(enable_validation=True)",
"def _get_disable_azure_monitor_metrics(self, enable_validation: bool = False) -> bool:\n # Read the original value passed by the command.\n disable_azure_monitor_met... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the value of enable_azure_monitor_metrics. This function will verify the parameter by default. If both enable_azure_monitor_metrics and disable_azure_monitor_metrics are specified, raise a MutuallyExclusiveArgumentError. | def get_enable_azure_monitor_metrics(self) -> bool:
return self._get_enable_azure_monitor_metrics(enable_validation=True) | [
"def _get_enable_azure_monitor_metrics(self, enable_validation: bool = False) -> bool:\n # print(\"_get_enable_azure_monitor_metrics being called...\")\n # Read the original value passed by the command.\n enable_azure_monitor_metrics = self.raw_param.get(\"enable_azure_monitor_metrics\")\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal function to obtain the value of disable_azure_monito4790r_metrics. This function supports the option of enable_validation. When enabled, if both enable_azure_monitor_metrics and disable_azure_monitor_metrics are specified, raise a MutuallyExclusiveArgumentError. | def _get_disable_azure_monitor_metrics(self, enable_validation: bool = False) -> bool:
# Read the original value passed by the command.
disable_azure_monitor_metrics = self.raw_param.get("disable_azure_monitor_metrics")
if enable_validation:
if disable_azure_monitor_metrics and self.... | [
"def get_disable_azure_monitor_metrics(self) -> bool:\n return self._get_disable_azure_monitor_metrics(enable_validation=True)",
"def _get_enable_azure_monitor_metrics(self, enable_validation: bool = False) -> bool:\n # print(\"_get_enable_azure_monitor_metrics being called...\")\n # Read the... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the value of disable_azure_monitor_metrics. This function will verify the parameter by default. If both enable_azure_monitor_metrics and disable_azure_monitor_metrics are specified, raise a MutuallyExclusiveArgumentError. | def get_disable_azure_monitor_metrics(self) -> bool:
return self._get_disable_azure_monitor_metrics(enable_validation=True) | [
"def _get_disable_azure_monitor_metrics(self, enable_validation: bool = False) -> bool:\n # Read the original value passed by the command.\n disable_azure_monitor_metrics = self.raw_param.get(\"disable_azure_monitor_metrics\")\n if enable_validation:\n if disable_azure_monitor_metric... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal function to obtain the value of enable_vpa. This function supports the option of enable_vpa. When enabled, if both enable_vpa and enable_vpa are specified, raise a MutuallyExclusiveArgumentError. | def _get_enable_vpa(self, enable_validation: bool = False) -> bool:
# Read the original value passed by the command.
enable_vpa = self.raw_param.get("enable_vpa")
# This parameter does not need dynamic completion.
if enable_validation:
if enable_vpa and self._get_disable_vpa... | [
"def get_enable_vpa(self) -> bool:\n return self._get_enable_vpa(enable_validation=True)",
"def _get_disable_vpa(self, enable_validation: bool = False) -> bool:\n # Read the original value passed by the command.\n disable_vpa = self.raw_param.get(\"disable_vpa\")\n\n # This option is n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the value of enable_vpa. This function will verify the parameter by default. If both enable_vpa and disable_vpa are specified, raise a MutuallyExclusiveArgumentError. | def get_enable_vpa(self) -> bool:
return self._get_enable_vpa(enable_validation=True) | [
"def _get_enable_vpa(self, enable_validation: bool = False) -> bool:\n # Read the original value passed by the command.\n enable_vpa = self.raw_param.get(\"enable_vpa\")\n\n # This parameter does not need dynamic completion.\n if enable_validation:\n if enable_vpa and self._ge... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal function to obtain the value of disable_vpa. This function supports the option of enable_vpa. When enabled, if both enable_vpa and disable_vpa are specified, raise a MutuallyExclusiveArgumentError. | def _get_disable_vpa(self, enable_validation: bool = False) -> bool:
# Read the original value passed by the command.
disable_vpa = self.raw_param.get("disable_vpa")
# This option is not supported in create mode, hence we do not read the property value from the `mc` object.
# This param... | [
"def get_disable_vpa(self) -> bool:\n return self._get_disable_vpa(enable_validation=True)",
"def _get_enable_vpa(self, enable_validation: bool = False) -> bool:\n # Read the original value passed by the command.\n enable_vpa = self.raw_param.get(\"enable_vpa\")\n\n # This parameter do... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Obtain the value of disable_vpa. This function will verify the parameter by default. If both enable_vpa and disable_vpa are specified, raise a MutuallyExclusiveArgumentError. | def get_disable_vpa(self) -> bool:
return self._get_disable_vpa(enable_validation=True) | [
"def _get_disable_vpa(self, enable_validation: bool = False) -> bool:\n # Read the original value passed by the command.\n disable_vpa = self.raw_param.get(\"disable_vpa\")\n\n # This option is not supported in create mode, hence we do not read the property value from the `mc` object.\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize an AKSManagedClusterModels object to store the models. | def init_models(self) -> None:
self.models = AKSManagedClusterModels(self.cmd, self.resource_type) | [
"def init_context(self) -> None:\n self.context = AKSManagedClusterContext(\n self.cmd, AKSManagedClusterParamDict(self.__raw_parameters), self.models, DecoratorMode.CREATE\n )",
"def _trainModels(self):\n\t\tbatch_items = []\n\t\tcluster_sizes = []\n\t\tseq_lens = []\n\t\t# Build a list ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize an AKSManagedClusterContext object to store the context in the process of assemble the ManagedCluster object. | def init_context(self) -> None:
self.context = AKSManagedClusterContext(
self.cmd, AKSManagedClusterParamDict(self.__raw_parameters), self.models, DecoratorMode.CREATE
) | [
"def init_context(self) -> None:\n self.context = AKSManagedClusterContext(\n self.cmd, AKSManagedClusterParamDict(self.__raw_parameters), self.models, DecoratorMode.UPDATE\n )",
"def init_mc(self) -> ManagedCluster:\n # Initialize a ManagedCluster object with mandatory parameter l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize an AKSAgentPoolAddDecorator object to assemble the AgentPool profile. | def init_agentpool_decorator_context(self) -> None:
self.agentpool_decorator = AKSAgentPoolAddDecorator(
self.cmd, self.client, self.__raw_parameters, self.resource_type, self.agentpool_decorator_mode
)
self.agentpool_context = self.agentpool_decorator.context
self.context.at... | [
"def init_agentpool_decorator_context(self) -> None:\n self.agentpool_decorator = AKSAgentPoolUpdateDecorator(\n self.cmd, self.client, self.__raw_parameters, self.resource_type, self.agentpool_decorator_mode\n )\n self.agentpool_context = self.agentpool_decorator.context\n se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal function to ensure that the incoming `mc` object is valid and the same as the attached `mc` object in the context. If the incoming `mc` is not valid or is inconsistent with the `mc` in the context, raise a CLIInternalError. | def _ensure_mc(self, mc: ManagedCluster) -> None:
if not isinstance(mc, self.models.ManagedCluster):
raise CLIInternalError(
"Unexpected mc object with type '{}'.".format(type(mc))
)
if self.context.mc != mc:
raise CLIInternalError(
"I... | [
"def _ensure_mc(self, mc: ManagedCluster) -> None:\n if not isinstance(mc, self.models.ManagedCluster):\n raise CLIInternalError(\n \"Unexpected mc object with type '{}'.\".format(type(mc))\n )\n\n if self.context.mc != mc:\n raise CLIInternalError(\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal function to remove values from properties with default values of the `mc` object. Removing default values is to prevent getters from mistakenly overwriting user provided values with default values in the object. | def _remove_defaults_in_mc(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
defaults_in_mc = {}
for attr_name, attr_value in vars(mc).items():
if not attr_name.startswith("_") and attr_name != "location" and attr_value is not None:
defaults_in_mc[attr... | [
"def _restore_defaults_in_mc(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n defaults_in_mc = self.context.get_intermediate(\"defaults_in_mc\", {})\n for key, value in defaults_in_mc.items():\n if getattr(mc, key, None) is None:\n setattr(mc, key... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal function to restore values of properties with default values of the `mc` object. Restoring default values is to keep the content of the request sent by cli consistent with that before the refactoring. | def _restore_defaults_in_mc(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
defaults_in_mc = self.context.get_intermediate("defaults_in_mc", {})
for key, value in defaults_in_mc.items():
if getattr(mc, key, None) is None:
setattr(mc, key, value)
... | [
"def _remove_defaults_in_mc(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n defaults_in_mc = {}\n for attr_name, attr_value in vars(mc).items():\n if not attr_name.startswith(\"_\") and attr_name != \"location\" and attr_value is not None:\n defa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up workload identity for the ManagedCluster object. | def set_up_workload_identity_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
profile = self.context.get_workload_identity_profile()
if profile:
if mc.security_profile is None:
mc.security_profile = self.models.ManagedClusterSecurityProfile()
... | [
"def set_up_identity(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n identity = None\n enable_managed_identity = self.context.get_enable_managed_identity()\n assign_identity = self.context.get_assign_identity()\n if enable_managed_identity and not assign_ide... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up defender for the ManagedCluster object. | def set_up_defender(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
defender = self.context.get_defender_config()
if defender:
if mc.security_profile is None:
mc.security_profile = self.models.ManagedClusterSecurityProfile()
mc.security_... | [
"def update_defender(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n defender = self.context.get_defender_config()\n if defender:\n if mc.security_profile is None:\n mc.security_profile = self.models.ManagedClusterSecurityProfile()\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up security profile azureKeyVaultKms for the ManagedCluster object. | def set_up_azure_keyvault_kms(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if self.context.get_enable_azure_keyvault_kms():
key_id = self.context.get_azure_keyvault_kms_key_id()
if key_id:
if mc.security_profile is None:
mc... | [
"def update_azure_keyvault_kms(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if self.context.get_enable_azure_keyvault_kms():\n # get kms profile\n if mc.security_profile is None:\n mc.security_profile = self.models.ManagedClusterSecurityPr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up security profile imageCleaner for the ManagedCluster object. | def set_up_image_cleaner(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
interval_hours = self.context.get_image_cleaner_interval_hours()
if self.context.get_enable_image_cleaner():
if mc.security_profile is None:
mc.security_profile = self.models.... | [
"def image_cleaner(self) -> Optional[pulumi.Input['ManagedClusterSecurityProfileImageCleanerArgs']]:\n return pulumi.get(self, \"image_cleaner\")",
"def update_image_cleaner(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n enable_image_cleaner = self.context.get_enable_i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize a ManagedCluster object with required parameter location and attach it to internal context. When location is not assigned, function "get_rg_location" will be called to get the location of the provided resource group, which internally used ResourceManagementClient to send the request. | def init_mc(self) -> ManagedCluster:
# Initialize a ManagedCluster object with mandatory parameter location.
mc = self.models.ManagedCluster(
location=self.context.get_location(),
)
# attach mc to AKSContext
self.context.attach_mc(mc)
return mc | [
"def init_context(self) -> None:\n self.context = AKSManagedClusterContext(\n self.cmd, AKSManagedClusterParamDict(self.__raw_parameters), self.models, DecoratorMode.CREATE\n )",
"def init_context(self) -> None:\n self.context = AKSManagedClusterContext(\n self.cmd, AKSM... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up agent pool profiles for the ManagedCluster object. | def set_up_agentpool_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
agentpool_profile = self.agentpool_decorator.construct_agentpool_profile_default()
mc.agent_pool_profiles = [agentpool_profile]
return mc | [
"def update_agentpool_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if not mc.agent_pool_profiles:\n raise UnknownError(\n \"Encounter an unexpected error while getting agent pool profiles from the cluster in the process of \"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up linux profile for the ManagedCluster object. Linux profile is just used for SSH access to VMs, so it will be omitted if nosshkey option was specified. | def set_up_linux_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
ssh_key_value, no_ssh_key = self.context.get_ssh_key_value_and_no_ssh_key()
if not no_ssh_key:
ssh_config = self.models.ContainerServiceSshConfiguration(
public_keys=[
... | [
"def linux_profile(self) -> Optional[pulumi.Input['KubernetesClusterLinuxProfileArgs']]:\n return pulumi.get(self, \"linux_profile\")",
"def test_create_hyperflex_cluster_profile(self):\n pass",
"def construct_mc_profile_default(self, bypass_restore_defaults: bool = False) -> ManagedCluster:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up windows profile for the ManagedCluster object. | def set_up_windows_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
(
windows_admin_username,
windows_admin_password,
) = self.context.get_windows_admin_username_and_password()
if windows_admin_username or windows_admin_password:
... | [
"def update_windows_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n enable_ahub = self.context.get_enable_ahub()\n disable_ahub = self.context.get_disable_ahub()\n windows_admin_password = self.context.get_windows_admin_password()\n enable_windows_gm... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up storage profile for the ManagedCluster object. | def set_up_storage_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if hasattr(self.models, "ManagedClusterStorageProfile"):
mc.storage_profile = self.context.get_storage_profile()
return mc | [
"def update_storage_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n mc.storage_profile = self.context.get_storage_profile()\n\n return mc",
"def get_storage_profile(self) -> Optional[ManagedClusterStorageProfile]:\n profile = self.models.ManagedClusterSto... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up service principal profile for the ManagedCluster object. | def set_up_service_principal_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
# If customer explicitly provide a service principal, disable managed identity.
(
service_principal,
client_secret,
) = self.context.get_service_principal_and_cl... | [
"def set_up_identity_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n identity_profile = None\n assign_kubelet_identity = self.context.get_assign_kubelet_identity()\n if assign_kubelet_identity:\n kubelet_identity = self.context.get_identity_by_ms... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add role assignment for vent subnet. This function will store an intermediate need_post_creation_vnet_permission_granting. The function "subnet_role_assignment_exists" will be called to verify if the role assignment already exists for the subnet, which internally used AuthorizationManagementClient to send the request. ... | def process_add_role_assignment_for_vnet_subnet(self, mc: ManagedCluster) -> None:
self._ensure_mc(mc)
need_post_creation_vnet_permission_granting = False
vnet_subnet_id = self.context.get_vnet_subnet_id()
skip_subnet_role_assignment = (
self.context.get_skip_subnet_role_ass... | [
"def _add_subnet(self, subnet_id, cidr, net_id, timestmp):\n identy, state = self._create_subnet_nodes(cidr)\n net_node = self._get_net_node(net_id)\n\n # if the net node exist means the network is active.\n if net_node is not None:\n subnet_node = self.graph_db.add_node(subne... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attach acr for the cluster. The function "ensure_aks_acr" will be called to create an AcrPull role assignment for the acr, which internally used AuthorizationManagementClient to send the request. | def process_attach_acr(self, mc: ManagedCluster) -> None:
self._ensure_mc(mc)
attach_acr = self.context.get_attach_acr()
if attach_acr:
# If enable_managed_identity, attach acr operation will be handled after the cluster is created
if not self.context.get_enable_managed_... | [
"def get_attach_acr(self) -> Union[str, None]:\n # read the original value passed by the command\n attach_acr = self.raw_param.get(\"attach_acr\")\n\n # this parameter does not need dynamic completion\n # validation\n if self.decorator_mode == DecoratorMode.CREATE and attach_acr:\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up network profile for the ManagedCluster object. Build load balancer profile, verify outbound type and load balancer sku first, then set up network profile. | def set_up_network_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
# build load balancer profile, which is part of the network profile
load_balancer_profile = create_load_balancer_profile(
self.context.get_load_balancer_managed_outbound_ip_count(),
... | [
"def set_up_agentpool_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n agentpool_profile = self.agentpool_decorator.construct_agentpool_profile_default()\n mc.agent_pool_profiles = [agentpool_profile]\n return mc",
"def update_load_balancer_profile(self, m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build http application routing addon profile. | def build_http_application_routing_addon_profile(self) -> ManagedClusterAddonProfile:
http_application_routing_addon_profile = self.models.ManagedClusterAddonProfile(
enabled=True,
)
return http_application_routing_addon_profile | [
"def build_ingress_appgw_addon_profile(self) -> ManagedClusterAddonProfile:\n # determine the value of constants\n addon_consts = self.context.get_addon_consts()\n CONST_INGRESS_APPGW_APPLICATION_GATEWAY_NAME = addon_consts.get(\n \"CONST_INGRESS_APPGW_APPLICATION_GATEWAY_NAME\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build kube dashboard addon profile. | def build_kube_dashboard_addon_profile(self) -> ManagedClusterAddonProfile:
kube_dashboard_addon_profile = self.models.ManagedClusterAddonProfile(
enabled=True,
)
return kube_dashboard_addon_profile | [
"def build_monitoring_addon_profile(self) -> ManagedClusterAddonProfile:\n # determine the value of constants\n addon_consts = self.context.get_addon_consts()\n CONST_MONITORING_LOG_ANALYTICS_WORKSPACE_RESOURCE_ID = addon_consts.get(\n \"CONST_MONITORING_LOG_ANALYTICS_WORKSPACE_RESOU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build monitoring addon profile. The function "ensure_container_insights_for_monitoring" will be called to create a deployment which publishes the Container Insights solution to the Log Analytics workspace. When workspace_resource_id is not assigned, function "ensure_default_log_analytics_workspace_for_monitoring" will ... | def build_monitoring_addon_profile(self) -> ManagedClusterAddonProfile:
# determine the value of constants
addon_consts = self.context.get_addon_consts()
CONST_MONITORING_LOG_ANALYTICS_WORKSPACE_RESOURCE_ID = addon_consts.get(
"CONST_MONITORING_LOG_ANALYTICS_WORKSPACE_RESOURCE_ID"
... | [
"def build_ingress_appgw_addon_profile(self) -> ManagedClusterAddonProfile:\n # determine the value of constants\n addon_consts = self.context.get_addon_consts()\n CONST_INGRESS_APPGW_APPLICATION_GATEWAY_NAME = addon_consts.get(\n \"CONST_INGRESS_APPGW_APPLICATION_GATEWAY_NAME\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build azure policy addon profile. | def build_azure_policy_addon_profile(self) -> ManagedClusterAddonProfile:
azure_policy_addon_profile = self.models.ManagedClusterAddonProfile(
enabled=True,
)
return azure_policy_addon_profile | [
"def build_azure_keyvault_secrets_provider_addon_profile(self) -> ManagedClusterAddonProfile:\n # determine the value of constants\n addon_consts = self.context.get_addon_consts()\n CONST_SECRET_ROTATION_ENABLED = addon_consts.get(\n \"CONST_SECRET_ROTATION_ENABLED\"\n )\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build virtual node addon profile. | def build_virtual_node_addon_profile(self) -> ManagedClusterAddonProfile:
# determine the value of constants
addon_consts = self.context.get_addon_consts()
CONST_VIRTUAL_NODE_SUBNET_NAME = addon_consts.get(
"CONST_VIRTUAL_NODE_SUBNET_NAME"
)
virtual_node_addon_profil... | [
"def test_create_hyperflex_node_profile(self):\n pass",
"def build_ext():\n print(\"build ext\")",
"def build_kube_dashboard_addon_profile(self) -> ManagedClusterAddonProfile:\n kube_dashboard_addon_profile = self.models.ManagedClusterAddonProfile(\n enabled=True,\n )\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build ingress appgw addon profile. | def build_ingress_appgw_addon_profile(self) -> ManagedClusterAddonProfile:
# determine the value of constants
addon_consts = self.context.get_addon_consts()
CONST_INGRESS_APPGW_APPLICATION_GATEWAY_NAME = addon_consts.get(
"CONST_INGRESS_APPGW_APPLICATION_GATEWAY_NAME"
)
... | [
"def build_http_application_routing_addon_profile(self) -> ManagedClusterAddonProfile:\n http_application_routing_addon_profile = self.models.ManagedClusterAddonProfile(\n enabled=True,\n )\n return http_application_routing_addon_profile",
"def create_app_profile(self, tenant=None,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build confcom addon profile. | def build_confcom_addon_profile(self) -> ManagedClusterAddonProfile:
# determine the value of constants
addon_consts = self.context.get_addon_consts()
CONST_ACC_SGX_QUOTE_HELPER_ENABLED = addon_consts.get(
"CONST_ACC_SGX_QUOTE_HELPER_ENABLED"
)
confcom_addon_profile ... | [
"def build_ingress_appgw_addon_profile(self) -> ManagedClusterAddonProfile:\n # determine the value of constants\n addon_consts = self.context.get_addon_consts()\n CONST_INGRESS_APPGW_APPLICATION_GATEWAY_NAME = addon_consts.get(\n \"CONST_INGRESS_APPGW_APPLICATION_GATEWAY_NAME\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build open service mesh addon profile. | def build_open_service_mesh_addon_profile(self) -> ManagedClusterAddonProfile:
open_service_mesh_addon_profile = self.models.ManagedClusterAddonProfile(
enabled=True,
config={},
)
return open_service_mesh_addon_profile | [
"def build_monitoring_addon_profile(self) -> ManagedClusterAddonProfile:\n # determine the value of constants\n addon_consts = self.context.get_addon_consts()\n CONST_MONITORING_LOG_ANALYTICS_WORKSPACE_RESOURCE_ID = addon_consts.get(\n \"CONST_MONITORING_LOG_ANALYTICS_WORKSPACE_RESOU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build azure keyvault secrets provider addon profile. | def build_azure_keyvault_secrets_provider_addon_profile(self) -> ManagedClusterAddonProfile:
# determine the value of constants
addon_consts = self.context.get_addon_consts()
CONST_SECRET_ROTATION_ENABLED = addon_consts.get(
"CONST_SECRET_ROTATION_ENABLED"
)
CONST_ROT... | [
"def update_azure_keyvault_secrets_provider_addon_profile(\n self,\n azure_keyvault_secrets_provider_addon_profile: ManagedClusterAddonProfile,\n ) -> ManagedClusterAddonProfile:\n # determine the value of constants\n addon_consts = self.context.get_addon_consts()\n CONST_SECRE... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up addon profiles for the ManagedCluster object. | def set_up_addon_profiles(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
# determine the value of constants
addon_consts = self.context.get_addon_consts()
CONST_MONITORING_ADDON_NAME = addon_consts.get(
"CONST_MONITORING_ADDON_NAME"
)
CONST_... | [
"def update_addon_profiles(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n # determine the value of constants\n addon_consts = self.context.get_addon_consts()\n CONST_MONITORING_ADDON_NAME = addon_consts.get(\n \"CONST_MONITORING_ADDON_NAME\"\n )\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up aad profile for the ManagedCluster object. | def set_up_aad_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
aad_profile = None
enable_aad = self.context.get_enable_aad()
if enable_aad:
aad_profile = self.models.ManagedClusterAADProfile(
managed=True,
enable_azure... | [
"def update_aad_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if self.context.get_enable_aad():\n mc.aad_profile = self.models.ManagedClusterAADProfile(\n managed=True\n )\n\n aad_tenant_id = self.context.get_aad_tenant_id()\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up OIDC issuer profile for the ManagedCluster object. | def set_up_oidc_issuer_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
oidc_issuer_profile = self.context.get_oidc_issuer_profile()
if oidc_issuer_profile is not None:
mc.oidc_issuer_profile = oidc_issuer_profile
return mc | [
"def update_oidc_issuer_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n oidc_issuer_profile = self.context.get_oidc_issuer_profile()\n if oidc_issuer_profile is not None:\n mc.oidc_issuer_profile = oidc_issuer_profile\n\n return mc",
"def set_up_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up workload autoscaler profile for the ManagedCluster object. | def set_up_workload_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if self.context.get_enable_keda():
if mc.workload_auto_scaler_profile is None:
mc.workload_auto_scaler_profile = self.models.ManagedClusterWorkloadAutoScalerProfile()
... | [
"def set_up_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n cluster_autoscaler_profile = self.context.get_cluster_autoscaler_profile()\n mc.auto_scaler_profile = cluster_autoscaler_profile\n return mc",
"def update_workload_auto_scaler_profile... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up api server access profile and fqdn subdomain for the ManagedCluster object. | def set_up_api_server_access_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
api_server_access_profile = None
api_server_authorized_ip_ranges = self.context.get_api_server_authorized_ip_ranges()
enable_private_cluster = self.context.get_enable_private_cluster()
... | [
"def update_api_server_access_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if mc.api_server_access_profile is None:\n profile_holder = self.models.ManagedClusterAPIServerAccessProfile()\n else:\n profile_holder = mc.api_server_access_profi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up identity for the ManagedCluster object. | def set_up_identity(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
identity = None
enable_managed_identity = self.context.get_enable_managed_identity()
assign_identity = self.context.get_assign_identity()
if enable_managed_identity and not assign_identity:
... | [
"def set_up_identity_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n identity_profile = None\n assign_kubelet_identity = self.context.get_assign_kubelet_identity()\n if assign_kubelet_identity:\n kubelet_identity = self.context.get_identity_by_ms... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up identity profile for the ManagedCluster object. The wrapper function "get_identity_by_msi_client" will be called (by "get_user_assigned_identity_object_id") to get the identity object, which internally use ManagedServiceIdentityClient to send the request. The function "ensure_cluster_identity_permission_on_kubel... | def set_up_identity_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
identity_profile = None
assign_kubelet_identity = self.context.get_assign_kubelet_identity()
if assign_kubelet_identity:
kubelet_identity = self.context.get_identity_by_msi_client(as... | [
"def set_up_identity(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n identity = None\n enable_managed_identity = self.context.get_enable_managed_identity()\n assign_identity = self.context.get_assign_identity()\n if enable_managed_identity and not assign_ide... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up http proxy config for the ManagedCluster object. | def set_up_http_proxy_config(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
mc.http_proxy_config = self.context.get_http_proxy_config()
return mc | [
"def update_http_proxy_config(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n mc.http_proxy_config = self.context.get_http_proxy_config()\n return mc",
"def configure_proxy(self, proxy):\n server_name = self.get_external_domain()\n tls_enabled = self.get_t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up auto upgrade profile for the ManagedCluster object. | def set_up_auto_upgrade_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
auto_upgrade_profile = None
auto_upgrade_channel = self.context.get_auto_upgrade_channel()
if auto_upgrade_channel:
auto_upgrade_profile = self.models.ManagedClusterAutoUpgradePr... | [
"def update_auto_upgrade_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n auto_upgrade_channel = self.context.get_auto_upgrade_channel()\n if auto_upgrade_channel is not None:\n if mc.auto_upgrade_profile is None:\n mc.auto_upgrade_profile... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up autoscaler profile for the ManagedCluster object. | def set_up_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
cluster_autoscaler_profile = self.context.get_cluster_autoscaler_profile()
mc.auto_scaler_profile = cluster_autoscaler_profile
return mc | [
"def set_up_workload_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if self.context.get_enable_keda():\n if mc.workload_auto_scaler_profile is None:\n mc.workload_auto_scaler_profile = self.models.ManagedClusterWorkloadAutoScalerPro... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up sku (uptime sla) for the ManagedCluster object. | def set_up_sku(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if self.context.get_uptime_sla() or self.context.get_tier() == CONST_MANAGED_CLUSTER_SKU_TIER_STANDARD:
mc.sku = self.models.ManagedClusterSKU(
name="Base",
tier="Standard"
... | [
"def update_sku(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n # Premium without LTS is ok (not vice versa)\n if self.context.get_tier() == CONST_MANAGED_CLUSTER_SKU_TIER_PREMIUM:\n mc.sku = self.models.ManagedClusterSKU(\n name=\"Base\",\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up extended location (edge zone) for the ManagedCluster object. | def set_up_extended_location(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
edge_zone = self.context.get_edge_zone()
if edge_zone:
mc.extended_location = self.models.ExtendedLocation(
name=edge_zone,
type=self.models.ExtendedLocation... | [
"def cluster_extended_location(self) -> pulumi.Output['outputs.ExtendedLocationResponse']:\n return pulumi.get(self, \"cluster_extended_location\")",
"def setup_coordinate_system(self):\n self.default_coordinate_system = CoordinateSystem(\n name='Ecliptic Coordinates')\n self.defau... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up node resource group for the ManagedCluster object. | def set_up_node_resource_group(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
mc.node_resource_group = self.context.get_node_resource_group()
return mc | [
"def create_cluster(self):\n # TODO: check available resources\n # self.check_available_resources()\n\n # TEMP\n # self.cleanup_cluster()\n\n self.logger.info(\"Creating new cluster for project '%s'...\", self.project_name)\n\n self.create_security_group()\n self.cre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up supportPlan for the ManagedCluster object. | def set_up_k8s_support_plan(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
support_plan = self.context.get_k8s_support_plan()
if support_plan == KubernetesSupportPlan.AKS_LONG_TERM_SUPPORT:
if mc is None or mc.sku is None or mc.sku.tier.lower() != CONST_MANAGED_CLU... | [
"def update_k8s_support_plan(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n support_plan = self.context.get_k8s_support_plan()\n if support_plan == KubernetesSupportPlan.AKS_LONG_TERM_SUPPORT:\n if mc is None or mc.sku is None or mc.sku.tier.lower() != CONST_M... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up azure monitor profile for the ManagedCluster object. | def set_up_azure_monitor_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
# read the original value passed by the command
ksm_metric_labels_allow_list = self.context.raw_param.get("ksm_metric_labels_allow_list")
ksm_metric_annotations_allow_list = self.context.raw... | [
"def update_azure_monitor_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n # read the original value passed by the command\n ksm_metric_labels_allow_list = self.context.raw_param.get(\"ksm_metric_labels_allow_list\")\n ksm_metric_annotations_allow_list = sel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The overall controller used to construct the default ManagedCluster profile. The completely constructed ManagedCluster object will later be passed as a parameter to the underlying SDK (mgmtcontainerservice) to send the actual request. | def construct_mc_profile_default(self, bypass_restore_defaults: bool = False) -> ManagedCluster:
# initialize the ManagedCluster object
mc = self.init_mc()
# DO NOT MOVE: remove defaults
self._remove_defaults_in_mc(mc)
# set up agentpool profile
mc = self.set_up_agentpoo... | [
"def update_mc_profile_default(self) -> ManagedCluster:\n # check raw parameters\n # promt y/n if no options are specified to ask user whether to perform a reconcile operation\n self.check_raw_parameters()\n # fetch the ManagedCluster object\n mc = self.fetch_mc()\n # updat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to check if postprocessing is required after sending a PUT request to create the cluster. | def check_is_postprocessing_required(self, mc: ManagedCluster) -> bool:
# some addons require post cluster creation role assigment
monitoring_addon_enabled = self.context.get_intermediate("monitoring_addon_enabled", default_value=False)
ingress_appgw_addon_enabled = self.context.get_intermediate... | [
"def check_is_postprocessing_required(self, mc: ManagedCluster) -> bool:\n # some addons require post cluster creation role assigment\n monitoring_addon_enabled = self.context.get_intermediate(\"monitoring_addon_enabled\", default_value=False)\n ingress_appgw_addon_enabled = self.context.get_in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize an AKSManagedClusterModels object to store the models. | def init_models(self) -> None:
self.models = AKSManagedClusterModels(self.cmd, self.resource_type) | [
"def init_context(self) -> None:\n self.context = AKSManagedClusterContext(\n self.cmd, AKSManagedClusterParamDict(self.__raw_parameters), self.models, DecoratorMode.CREATE\n )",
"def _trainModels(self):\n\t\tbatch_items = []\n\t\tcluster_sizes = []\n\t\tseq_lens = []\n\t\t# Build a list ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize an AKSManagedClusterContext object to store the context in the process of assemble the ManagedCluster object. | def init_context(self) -> None:
self.context = AKSManagedClusterContext(
self.cmd, AKSManagedClusterParamDict(self.__raw_parameters), self.models, DecoratorMode.UPDATE
) | [
"def init_context(self) -> None:\n self.context = AKSManagedClusterContext(\n self.cmd, AKSManagedClusterParamDict(self.__raw_parameters), self.models, DecoratorMode.CREATE\n )",
"def init_mc(self) -> ManagedCluster:\n # Initialize a ManagedCluster object with mandatory parameter l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Initialize an AKSAgentPoolAddDecorator object to assemble the AgentPool profile. | def init_agentpool_decorator_context(self) -> None:
self.agentpool_decorator = AKSAgentPoolUpdateDecorator(
self.cmd, self.client, self.__raw_parameters, self.resource_type, self.agentpool_decorator_mode
)
self.agentpool_context = self.agentpool_decorator.context
self.context... | [
"def init_agentpool_decorator_context(self) -> None:\n self.agentpool_decorator = AKSAgentPoolAddDecorator(\n self.cmd, self.client, self.__raw_parameters, self.resource_type, self.agentpool_decorator_mode\n )\n self.agentpool_context = self.agentpool_decorator.context\n self.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to check whether any parameters are set. If the values of all the parameters are the default values, the command execution will be terminated early and raise a RequiredArgumentMissingError. Neither the request to fetch or update the ManagedCluster object will be sent. | def check_raw_parameters(self):
# exclude some irrelevant or mandatory parameters
excluded_keys = ("cmd", "client", "resource_group_name", "name")
# check whether the remaining parameters are set
# the default value None or False (and other empty values, like empty string) will be consid... | [
"def check_required(self):\n for argument in self.arguments:\n if argument.required:\n raise ArgumentRequiredError(argument, self.tagname)\n else:\n self.kwargs[argument.name] = argument.get_default()",
"def check_required(self):\r\n for argument i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Internal function to ensure that the incoming `mc` object is valid and the same as the attached `mc` object in the context. If the incomding `mc` is not valid or is inconsistent with the `mc` in the context, raise a CLIInternalError. | def _ensure_mc(self, mc: ManagedCluster) -> None:
if not isinstance(mc, self.models.ManagedCluster):
raise CLIInternalError(
"Unexpected mc object with type '{}'.".format(type(mc))
)
if self.context.mc != mc:
raise CLIInternalError(
"I... | [
"def _ensure_mc(self, mc: ManagedCluster) -> None:\n if not isinstance(mc, self.models.ManagedCluster):\n raise CLIInternalError(\n \"Unexpected mc object with type '{}'.\".format(type(mc))\n )\n\n if self.context.mc != mc:\n raise CLIInternalError(\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the ManagedCluster object currently in use and attach it to internal context. Internally send request using ContainerServiceClient and parameters name (cluster) and resource group name. | def fetch_mc(self) -> ManagedCluster:
mc = self.client.get(self.context.get_resource_group_name(), self.context.get_name())
# attach mc to AKSContext
self.context.attach_mc(mc)
return mc | [
"def init_mc(self) -> ManagedCluster:\n # Initialize a ManagedCluster object with mandatory parameter location.\n mc = self.models.ManagedCluster(\n location=self.context.get_location(),\n )\n\n # attach mc to AKSContext\n self.context.attach_mc(mc)\n return mc",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update agentpool profile for the ManagedCluster object. | def update_agentpool_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if not mc.agent_pool_profiles:
raise UnknownError(
"Encounter an unexpected error while getting agent pool profiles from the cluster in the process of "
"updating ag... | [
"def set_up_agentpool_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n agentpool_profile = self.agentpool_decorator.construct_agentpool_profile_default()\n mc.agent_pool_profiles = [agentpool_profile]\n return mc",
"def update_profile(client, logger):\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update autoscaler profile for the ManagedCluster object. | def update_auto_scaler_profile(self, mc):
self._ensure_mc(mc)
cluster_autoscaler_profile = self.context.get_cluster_autoscaler_profile()
if cluster_autoscaler_profile is not None:
# update profile (may clear profile with empty dictionary)
mc.auto_scaler_profile = cluster... | [
"def set_up_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n cluster_autoscaler_profile = self.context.get_cluster_autoscaler_profile()\n mc.auto_scaler_profile = cluster_autoscaler_profile\n return mc",
"def update_workload_auto_scaler_profile... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update tags for the ManagedCluster object. | def update_tags(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
tags = self.context.get_tags()
if tags is not None:
mc.tags = tags
return mc | [
"def UpdateCluster(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)",
"def UpdateCluster(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)",
"def update_cluster(self, context, cluster_values, cluster_id):",
"def update_tags(self, tags: L... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attach or detach acr for the cluster. The function "ensure_aks_acr" will be called to create or delete an AcrPull role assignment for the acr, which internally used AuthorizationManagementClient to send the request. | def process_attach_detach_acr(self, mc: ManagedCluster) -> None:
self._ensure_mc(mc)
subscription_id = self.context.get_subscription_id()
assignee, is_service_principal = self.context.get_assignee_from_identity_or_sp_profile()
attach_acr = self.context.get_attach_acr()
detach_ac... | [
"def process_attach_acr(self, mc: ManagedCluster) -> None:\n self._ensure_mc(mc)\n\n attach_acr = self.context.get_attach_acr()\n if attach_acr:\n # If enable_managed_identity, attach acr operation will be handled after the cluster is created\n if not self.context.get_enab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update sku (uptime sla) for the ManagedCluster object. | def update_sku(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
# Premium without LTS is ok (not vice versa)
if self.context.get_tier() == CONST_MANAGED_CLUSTER_SKU_TIER_PREMIUM:
mc.sku = self.models.ManagedClusterSKU(
name="Base",
tie... | [
"def set_up_sku(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if self.context.get_uptime_sla() or self.context.get_tier() == CONST_MANAGED_CLUSTER_SKU_TIER_STANDARD:\n mc.sku = self.models.ManagedClusterSKU(\n name=\"Base\",\n tier=\"St... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update outbound type of network profile for the ManagedCluster object. | def update_outbound_type_in_network_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
outboundType = self.context.get_outbound_type()
if outboundType:
vnet_subnet_id = self.context.get_vnet_subnet_id()
if vnet_subnet_id is None and outboundType not... | [
"def update_nat_gateway_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if not mc.network_profile:\n raise UnknownError(\n \"Unexpectedly get an empty network profile in the process of updating nat gateway profile.\"\n )\n outb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update load balancer profile for the ManagedCluster object. | def update_load_balancer_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if not mc.network_profile:
raise UnknownError(
"Encounter an unexpected error while getting network profile from the cluster in the process of "
"updating its lo... | [
"def update_agentpool_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if not mc.agent_pool_profiles:\n raise UnknownError(\n \"Encounter an unexpected error while getting agent pool profiles from the cluster in the process of \"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update nat gateway profile for the ManagedCluster object. | def update_nat_gateway_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if not mc.network_profile:
raise UnknownError(
"Unexpectedly get an empty network profile in the process of updating nat gateway profile."
)
outbound_type = se... | [
"def update_mc_profile_default(self) -> ManagedCluster:\n # check raw parameters\n # promt y/n if no options are specified to ask user whether to perform a reconcile operation\n self.check_raw_parameters()\n # fetch the ManagedCluster object\n mc = self.fetch_mc()\n # updat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update disable/enable local accounts for the ManagedCluster object. | def update_disable_local_accounts(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if self.context.get_disable_local_accounts():
mc.disable_local_accounts = True
if self.context.get_enable_local_accounts():
mc.disable_local_accounts = False
retur... | [
"def modify_remote_cluster(self, remote_cluster_name, require_encryption):\n for remote_cluster in self.__remote_clusters:\n if remote_cluster_name == remote_cluster.get_name():\n remote_cluster. modify(require_encryption)\n break\n else:\n raise XDC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update api server access profile and fqdn subdomain for the ManagedCluster object. | def update_api_server_access_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if mc.api_server_access_profile is None:
profile_holder = self.models.ManagedClusterAPIServerAccessProfile()
else:
profile_holder = mc.api_server_access_profile
... | [
"def set_up_api_server_access_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n api_server_access_profile = None\n api_server_authorized_ip_ranges = self.context.get_api_server_authorized_ip_ranges()\n enable_private_cluster = self.context.get_enable_private_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update windows profile for the ManagedCluster object. | def update_windows_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
enable_ahub = self.context.get_enable_ahub()
disable_ahub = self.context.get_disable_ahub()
windows_admin_password = self.context.get_windows_admin_password()
enable_windows_gmsa = self.c... | [
"def set_up_windows_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n (\n windows_admin_username,\n windows_admin_password,\n ) = self.context.get_windows_admin_username_and_password()\n if windows_admin_username or windows_admin_passwor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update aad profile for the ManagedCluster object. | def update_aad_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if self.context.get_enable_aad():
mc.aad_profile = self.models.ManagedClusterAADProfile(
managed=True
)
aad_tenant_id = self.context.get_aad_tenant_id()
aad_a... | [
"def update_mc_profile_default(self) -> ManagedCluster:\n # check raw parameters\n # promt y/n if no options are specified to ask user whether to perform a reconcile operation\n self.check_raw_parameters()\n # fetch the ManagedCluster object\n mc = self.fetch_mc()\n # updat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update OIDC issuer profile for the ManagedCluster object. | def update_oidc_issuer_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
oidc_issuer_profile = self.context.get_oidc_issuer_profile()
if oidc_issuer_profile is not None:
mc.oidc_issuer_profile = oidc_issuer_profile
return mc | [
"def set_up_oidc_issuer_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n oidc_issuer_profile = self.context.get_oidc_issuer_profile()\n if oidc_issuer_profile is not None:\n mc.oidc_issuer_profile = oidc_issuer_profile\n\n return mc",
"def update_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update auto upgrade profile for the ManagedCluster object. | def update_auto_upgrade_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
auto_upgrade_channel = self.context.get_auto_upgrade_channel()
if auto_upgrade_channel is not None:
if mc.auto_upgrade_profile is None:
mc.auto_upgrade_profile = self.mod... | [
"def set_up_auto_upgrade_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n auto_upgrade_profile = None\n auto_upgrade_channel = self.context.get_auto_upgrade_channel()\n if auto_upgrade_channel:\n auto_upgrade_profile = self.models.ManagedClusterAu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update network plugin settings of network profile for the ManagedCluster object. | def update_network_plugin_settings(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
network_plugin_mode = self.context.get_network_plugin_mode()
if network_plugin_mode:
mc.network_profile.network_plugin_mode = network_plugin_mode
(
pod_cidr,
... | [
"def _update_profile_cluster_settings(nodes, logger=None):\n stored_nodes = {node['hostname'] for node in env.profile.cluster}\n received_nodes = {node['hostname'] for node in nodes}\n if env.profile.cluster is None:\n env.profile.cluster = []\n for node in nodes:\n if node['hostname'] not... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set up http proxy config for the ManagedCluster object. | def update_http_proxy_config(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
mc.http_proxy_config = self.context.get_http_proxy_config()
return mc | [
"def set_up_http_proxy_config(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n mc.http_proxy_config = self.context.get_http_proxy_config()\n return mc",
"def configure_proxy(self, proxy):\n server_name = self.get_external_domain()\n tls_enabled = self.get_t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update identity for the ManagedCluster object. | def update_identity(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
current_identity_type = "spn"
current_user_assigned_identity = ""
if mc.identity is not None:
current_identity_type = mc.identity.type.casefold()
if mc.identity.user_assigned_ide... | [
"def update_identity_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n assign_kubelet_identity = self.context.get_assign_kubelet_identity()\n if assign_kubelet_identity:\n identity_profile = {\n 'kubeletidentity': self.models.UserAssignedId... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update azure keyvault secrets provider addon profile. | def update_azure_keyvault_secrets_provider_addon_profile(
self,
azure_keyvault_secrets_provider_addon_profile: ManagedClusterAddonProfile,
) -> ManagedClusterAddonProfile:
# determine the value of constants
addon_consts = self.context.get_addon_consts()
CONST_SECRET_ROTATION_... | [
"def build_azure_keyvault_secrets_provider_addon_profile(self) -> ManagedClusterAddonProfile:\n # determine the value of constants\n addon_consts = self.context.get_addon_consts()\n CONST_SECRET_ROTATION_ENABLED = addon_consts.get(\n \"CONST_SECRET_ROTATION_ENABLED\"\n )\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update addon profiles for the ManagedCluster object. | def update_addon_profiles(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
# determine the value of constants
addon_consts = self.context.get_addon_consts()
CONST_MONITORING_ADDON_NAME = addon_consts.get(
"CONST_MONITORING_ADDON_NAME"
)
CONST_... | [
"def update_profile(client, logger):\n logger.info('Fetching the cluster nodes list...')\n nodes = client.manager.get_managers().items\n _update_profile_cluster_settings(nodes, logger=logger)\n logger.info('Profile is up to date with {0} nodes'\n .format(len(env.profile.cluster)))",
"de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update storage profile for the ManagedCluster object. | def update_storage_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
mc.storage_profile = self.context.get_storage_profile()
return mc | [
"def set_up_storage_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if hasattr(self.models, \"ManagedClusterStorageProfile\"):\n mc.storage_profile = self.context.get_storage_profile()\n\n return mc",
"def cluster_profile(self, cluster_profile):\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update defender for the ManagedCluster object. | def update_defender(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
defender = self.context.get_defender_config()
if defender:
if mc.security_profile is None:
mc.security_profile = self.models.ManagedClusterSecurityProfile()
mc.security_... | [
"def set_up_defender(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n defender = self.context.get_defender_config()\n if defender:\n if mc.security_profile is None:\n mc.security_profile = self.models.ManagedClusterSecurityProfile()\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update workload identity profile for the ManagedCluster object. | def update_workload_identity_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
profile = self.context.get_workload_identity_profile()
if profile:
if mc.security_profile is None:
mc.security_profile = self.models.ManagedClusterSecurityProfile()
... | [
"def update_identity_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n assign_kubelet_identity = self.context.get_assign_kubelet_identity()\n if assign_kubelet_identity:\n identity_profile = {\n 'kubeletidentity': self.models.UserAssignedId... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update supportPlan for the ManagedCluster object. | def update_k8s_support_plan(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
support_plan = self.context.get_k8s_support_plan()
if support_plan == KubernetesSupportPlan.AKS_LONG_TERM_SUPPORT:
if mc is None or mc.sku is None or mc.sku.tier.lower() != CONST_MANAGED_CLU... | [
"def set_up_k8s_support_plan(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n support_plan = self.context.get_k8s_support_plan()\n if support_plan == KubernetesSupportPlan.AKS_LONG_TERM_SUPPORT:\n if mc is None or mc.sku is None or mc.sku.tier.lower() != CONST_M... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update security profile azureKeyvaultKms for the ManagedCluster object. | def update_azure_keyvault_kms(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if self.context.get_enable_azure_keyvault_kms():
# get kms profile
if mc.security_profile is None:
mc.security_profile = self.models.ManagedClusterSecurityProfile()
... | [
"def set_up_azure_keyvault_kms(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n if self.context.get_enable_azure_keyvault_kms():\n key_id = self.context.get_azure_keyvault_kms_key_id()\n if key_id:\n if mc.security_profile is None:\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update security profile imageCleaner for the ManagedCluster object. | def update_image_cleaner(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
enable_image_cleaner = self.context.get_enable_image_cleaner()
disable_image_cleaner = self.context.get_disable_image_cleaner()
interval_hours = self.context.get_image_cleaner_interval_hours()
... | [
"def set_up_image_cleaner(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n interval_hours = self.context.get_image_cleaner_interval_hours()\n\n if self.context.get_enable_image_cleaner():\n\n if mc.security_profile is None:\n mc.security_profile =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update identity profile for the ManagedCluster object. | def update_identity_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
assign_kubelet_identity = self.context.get_assign_kubelet_identity()
if assign_kubelet_identity:
identity_profile = {
'kubeletidentity': self.models.UserAssignedIdentity(
... | [
"def update_workload_identity_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n\n profile = self.context.get_workload_identity_profile()\n if profile:\n if mc.security_profile is None:\n mc.security_profile = self.models.ManagedClusterSecurit... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update workload autoscaler profile for the ManagedCluster object. | def update_workload_auto_scaler_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
if self.context.get_enable_keda():
if mc.workload_auto_scaler_profile is None:
mc.workload_auto_scaler_profile = self.models.ManagedClusterWorkloadAutoScalerProfile()
... | [
"def update_auto_scaler_profile(self, mc):\n self._ensure_mc(mc)\n\n cluster_autoscaler_profile = self.context.get_cluster_autoscaler_profile()\n if cluster_autoscaler_profile is not None:\n # update profile (may clear profile with empty dictionary)\n mc.auto_scaler_profil... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update azure monitor profile for the ManagedCluster object. | def update_azure_monitor_profile(self, mc: ManagedCluster) -> ManagedCluster:
self._ensure_mc(mc)
# read the original value passed by the command
ksm_metric_labels_allow_list = self.context.raw_param.get("ksm_metric_labels_allow_list")
ksm_metric_annotations_allow_list = self.context.ra... | [
"def set_up_azure_monitor_profile(self, mc: ManagedCluster) -> ManagedCluster:\n self._ensure_mc(mc)\n # read the original value passed by the command\n ksm_metric_labels_allow_list = self.context.raw_param.get(\"ksm_metric_labels_allow_list\")\n ksm_metric_annotations_allow_list = self.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The overall controller used to update the default ManagedCluster profile. The completely updated ManagedCluster object will later be passed as a parameter to the underlying SDK (mgmtcontainerservice) to send the actual request. | def update_mc_profile_default(self) -> ManagedCluster:
# check raw parameters
# promt y/n if no options are specified to ask user whether to perform a reconcile operation
self.check_raw_parameters()
# fetch the ManagedCluster object
mc = self.fetch_mc()
# update agentpool... | [
"def UpdateCluster(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)",
"def UpdateCluster(self, request, context):\n context.code(beta_interfaces.StatusCode.UNIMPLEMENTED)",
"def fusion_api_update_hypervisor_cluster_profile(self, uri=None, body=None, api=None, headers=Non... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to check if postprocessing is required after sending a PUT request to create the cluster. | def check_is_postprocessing_required(self, mc: ManagedCluster) -> bool:
# some addons require post cluster creation role assigment
monitoring_addon_enabled = self.context.get_intermediate("monitoring_addon_enabled", default_value=False)
ingress_appgw_addon_enabled = self.context.get_intermediate... | [
"def check_is_postprocessing_required(self, mc: ManagedCluster) -> bool:\n # some addons require post cluster creation role assigment\n monitoring_addon_enabled = self.context.get_intermediate(\"monitoring_addon_enabled\", default_value=False)\n ingress_appgw_addon_enabled = self.context.get_in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate metadata and store them in a YAML file with given arguments. | def gen_metadata(args):
with open(args.bibfile) as bibfile:
bib_db = BibTexParser(common_strings=True).parse_file(bibfile)
entries = sorted(list(bib_db.entries),
key=lambda x: x['year'], reverse=True)
list([update_file(entry) for entry in entries])
annotation... | [
"def user_create_yaml(self):\n pass",
"def task_generate_virtual_metadata():\n script = Path(__file__).parents[0] / \"generate_metadata_virtual_experiment.py\"\n metadata_files = Path(__file__).parent.glob('*_meta.yaml')\n\n return {\n \"actions\": [f\"{PYTHON_EXE} {script}\"],\n \"f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To parse command line and process the paper organization task. | def organize_bib():
parser = argparse.ArgumentParser(description='Organize papers')
parser.add_argument('bibfile', help='The bibtex file to be processed.')
subparsers = parser.add_subparsers(help='Available commands')
help_tmpl = 'Create a YAML file describing metadata for the organization tasks.'
... | [
"def parse_cli_args():\n __description__ = \"\"\"\nPETRARCH\n(eventdata.psu.edu) (v. 0.01)\n \"\"\"\n aparse = argparse.ArgumentParser(prog='PETRARCH',\n description=__description__)\n\n sub_parse = aparse.add_subparsers(dest='command_name')\n parse_command = sub_p... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks the self._execute_frequency to figure out the oid to use for cpu_utilization | def _get_cpu_interval(self):
self._polling_execute_frequency = int(self._plugin_conf[u'main'][u'polling_frequency'])
if 5 <= self._polling_execute_frequency < 60:
return cpmCPUTotalMonIntervalValue # replaces cpmCPUTotal5SecRev
elif 60 <= self._polling_execute_frequency < 300:
... | [
"def cpuStats():",
"def cpu(self):\n return self.no_params_func(\"cpu\", delete_after_use=False)",
"def processor_usage(self):\n try:\n raw_data = self.__exec_sys_command(\"top\", \"-bn1\")\n line = str(raw_data.stdout, 'utf-8').split('\\n', 3)[2]\n cpu = re.search... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |