@Samuel.Yan , thank you for your question.
1 How to check my cluster config for variable cluster_params, is there a tool?
At the time of writing, there is no out-of-box tool to validate AKS python SDK method parameters. However, in this particular case, you might want to check out the azure.mgmt.containerservice.v2021_08_01.operations.managedclustersoperations
begin_create_or_update method's inputs and their formats.
The parameters
Parameter to the method should be a ManagedCluster object with the following Constructor:
ManagedCluster(*, location: str, tags: typing.Union[typing.Dict[str, str], NoneType] = None, sku: typing.Union[_ForwardRef('ManagedClusterSKU'), NoneType] = None, extended_location: typing.Union[_ForwardRef('ExtendedLocation'), NoneType] = None, identity: typing.Union[_ForwardRef('ManagedClusterIdentity'), NoneType] = None, kubernetes_version: typing.Union[str, NoneType] = None, dns_prefix: typing.Union[str, NoneType] = None, fqdn_subdomain: typing.Union[str, NoneType] = None, agent_pool_profiles: typing.Union[typing.List[_ForwardRef('ManagedClusterAgentPoolProfile')], NoneType] = None, linux_profile: typing.Union[_ForwardRef('ContainerServiceLinuxProfile'), NoneType] = None, windows_profile: typing.Union[_ForwardRef('ManagedClusterWindowsProfile'), NoneType] = None, service_principal_profile: typing.Union[_ForwardRef('ManagedClusterServicePrincipalProfile'), NoneType] = None, addon_profiles: typing.Union[typing.Dict[str, _ForwardRef('ManagedClusterAddonProfile')], NoneType] = None, pod_identity_profile: typing.Union[_ForwardRef('ManagedClusterPodIdentityProfile'), NoneType] = None, node_resource_group: typing.Union[str, NoneType] = None, enable_rbac: typing.Union[bool, NoneType] = None, enable_pod_security_policy: typing.Union[bool, NoneType] = None, network_profile: typing.Union[_ForwardRef('ContainerServiceNetworkProfile'), NoneType] = None, aad_profile: typing.Union[_ForwardRef('ManagedClusterAADProfile'), NoneType] = None, auto_upgrade_profile: typing.Union[_ForwardRef('ManagedClusterAutoUpgradeProfile'), NoneType] = None, auto_scaler_profile: typing.Union[_ForwardRef('ManagedClusterPropertiesAutoScalerProfile'), NoneType] = None, api_server_access_profile: typing.Union[_ForwardRef('ManagedClusterAPIServerAccessProfile'), NoneType] = None, disk_encryption_set_id: typing.Union[str, NoneType] = None, identity_profile: typing.Union[typing.Dict[str, _ForwardRef('UserAssignedIdentity')], NoneType] = None, private_link_resources: typing.Union[typing.List[_ForwardRef('PrivateLinkResource')], NoneType] = None, disable_local_accounts: typing.Union[bool, NoneType] = None, http_proxy_config: typing.Union[_ForwardRef('ManagedClusterHTTPProxyConfig'), NoneType] = None, security_profile: typing.Union[_ForwardRef('ManagedClusterSecurityProfile'), NoneType] = None, public_network_access: typing.Union[str, _ForwardRef('PublicNetworkAccess'), NoneType] = None, **kwargs)
You can find the begin_create_or_update method definition here.
2 And is there a api to call az command.
client =Xxx.Client()
response = client.execute('az aks create ...')
Azure CLI is a client side command-line tool (written using Azure Python SDK) which can make REST API calls to the Azure Resource Manager
The definition for Azure CLI's aks_create
method in /azure-cli/azure/cli/command_modules/acs/custom.py
is as detailed here. Thus, in the end it will go back to using the Azure Python SDK.
----------
Hope this helps.
Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.