#問題陳述
我們需要創建實例配置文件通過磚REST API,但端點返回一個“INVALID_PARAMETER_VALUE”錯誤“語法無效AWS實例配置文件是“提供一個適當的消息,即使是作為輸入。
#是做什麼
#代碼
def create_instance_profile (instance_profile_arn skip_validation = False): api_command = ' / instance-profiles /添加api_version = f / api / 2.0的url = f“https:// {DATABRICKS_HOST} {api_version} {api_command} " params = {“instance_profile_arn”: instance_profile_arn,“skip_validation”: skip_validation,“is_meta_instance_profile”:假}頭={“接受”:“application / json scim +”,“授權”:f“無記名{DATABRICKS_TOKEN}} =響應請求。帖子(url, params = params,頭=頭)打印(json.dumps (json.loads (response.text),縮進= 2))在攻擊=“攻擊:aws:我::< account_id >: instance-profile / my-instance-profile-name”create_instance_profile(攻擊)