Exemplo n.º 1
0
def update_k8s_extension(cmd,
                         client,
                         resource_group_name,
                         cluster_type,
                         cluster_name,
                         name,
                         auto_upgrade_minor_version='',
                         release_train='',
                         version='',
                         tags=None):

    print("In update!")

    # Ensure some values are provided for update
    if auto_upgrade_minor_version is None and release_train is None and version is None:
        message = "No values provided for update. Provide new value(s) for one or more of these properties:" \
                  " auto_upgrade_minor_version, release_train or version."
        CLIError(message)

    # Determine ClusterRP
    cluster_rp = __get_cluster_type(cluster_type)
    upd_extension = ExtensionInstanceUpdate(
        auto_upgrade_minor_version=auto_upgrade_minor_version,
        release_train=release_train,
        version=version)

    return client.update(resource_group_name, cluster_rp, cluster_type,
                         cluster_name, name, upd_extension)
Exemplo n.º 2
0
    def Update(self, extension, auto_upgrade_minor_version, release_train,
               version):
        """ExtensionType 'microsoft.azuredefender.kubernetes' specific validations & defaults for Update
           Must create and return a valid 'ExtensionInstanceUpdate' object.

        """
        return ExtensionInstanceUpdate(
            auto_upgrade_minor_version=auto_upgrade_minor_version,
            release_train=release_train,
            version=version)
    def Update(self, extension, auto_upgrade_minor_version, release_train, version):
        """Default validations & defaults for Update
           Must create and return a valid 'ExtensionInstanceUpdate' object.

        """
        return ExtensionInstanceUpdate(
            auto_upgrade_minor_version=auto_upgrade_minor_version,
            release_train=release_train,
            version=version
        )