appwrite-console 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- appwrite_console/__init__.py +1 -0
- appwrite_console/client.py +371 -0
- appwrite_console/encoders/__init__.py +1 -0
- appwrite_console/encoders/value_class_encoder.py +373 -0
- appwrite_console/enums/__init__.py +1 -0
- appwrite_console/enums/account_key_scopes.py +6 -0
- appwrite_console/enums/adapter.py +5 -0
- appwrite_console/enums/addon.py +7 -0
- appwrite_console/enums/appwrite_migration_resource.py +42 -0
- appwrite_console/enums/attribute_status.py +8 -0
- appwrite_console/enums/authentication_factor.py +7 -0
- appwrite_console/enums/authenticator_type.py +4 -0
- appwrite_console/enums/backup_services.py +10 -0
- appwrite_console/enums/billing_plan_group.py +6 -0
- appwrite_console/enums/block_mode.py +5 -0
- appwrite_console/enums/block_resource_type.py +12 -0
- appwrite_console/enums/browser.py +17 -0
- appwrite_console/enums/browser_permission.py +23 -0
- appwrite_console/enums/browser_theme.py +5 -0
- appwrite_console/enums/build_runtime.py +95 -0
- appwrite_console/enums/cache_database.py +6 -0
- appwrite_console/enums/cache_target.py +9 -0
- appwrite_console/enums/column_status.py +8 -0
- appwrite_console/enums/compression.py +6 -0
- appwrite_console/enums/console_resource_type.py +4 -0
- appwrite_console/enums/credit_card.py +20 -0
- appwrite_console/enums/database_status.py +17 -0
- appwrite_console/enums/database_type.py +10 -0
- appwrite_console/enums/databases_index_type.py +7 -0
- appwrite_console/enums/deployment_download_type.py +5 -0
- appwrite_console/enums/deployment_status.py +9 -0
- appwrite_console/enums/detection_framework_type.py +4 -0
- appwrite_console/enums/detection_runtime_type.py +4 -0
- appwrite_console/enums/documents_db_index_type.py +6 -0
- appwrite_console/enums/domain_purchase_status.py +7 -0
- appwrite_console/enums/domain_registration_type.py +7 -0
- appwrite_console/enums/domain_suggestion_type.py +5 -0
- appwrite_console/enums/domain_transfer_status_enum.py +11 -0
- appwrite_console/enums/embedding_model.py +7 -0
- appwrite_console/enums/execution_method.py +10 -0
- appwrite_console/enums/execution_status.py +8 -0
- appwrite_console/enums/execution_trigger.py +6 -0
- appwrite_console/enums/firebase_migration_resource.py +13 -0
- appwrite_console/enums/flag.py +198 -0
- appwrite_console/enums/framework.py +18 -0
- appwrite_console/enums/function_template_use_case.py +10 -0
- appwrite_console/enums/image_format.py +10 -0
- appwrite_console/enums/image_gravity.py +12 -0
- appwrite_console/enums/index_status.py +8 -0
- appwrite_console/enums/message_priority.py +5 -0
- appwrite_console/enums/message_status.py +8 -0
- appwrite_console/enums/messaging_provider_type.py +6 -0
- appwrite_console/enums/n_host_migration_resource.py +14 -0
- appwrite_console/enums/o_auth2_google_prompt.py +6 -0
- appwrite_console/enums/o_auth2_oidc_prompt.py +7 -0
- appwrite_console/enums/o_auth_provider.py +47 -0
- appwrite_console/enums/on_duplicate.py +6 -0
- appwrite_console/enums/order_by.py +5 -0
- appwrite_console/enums/organization_key_scopes.py +19 -0
- appwrite_console/enums/password_hash.py +14 -0
- appwrite_console/enums/platform.py +5 -0
- appwrite_console/enums/platform_type.py +8 -0
- appwrite_console/enums/project_auth_method_id.py +10 -0
- appwrite_console/enums/project_email_template_id.py +10 -0
- appwrite_console/enums/project_email_template_locale.py +134 -0
- appwrite_console/enums/project_key_scopes.py +107 -0
- appwrite_console/enums/project_o_auth2_google_prompt.py +6 -0
- appwrite_console/enums/project_o_auth2_oidc_prompt.py +7 -0
- appwrite_console/enums/project_o_auth_provider_id.py +47 -0
- appwrite_console/enums/project_policy_id.py +17 -0
- appwrite_console/enums/project_protocol_id.py +6 -0
- appwrite_console/enums/project_service_id.py +22 -0
- appwrite_console/enums/project_smtp_secure.py +5 -0
- appwrite_console/enums/project_usage_range.py +5 -0
- appwrite_console/enums/proxy_resource_type.py +5 -0
- appwrite_console/enums/proxy_rule_deployment_resource_type.py +5 -0
- appwrite_console/enums/proxy_rule_status.py +6 -0
- appwrite_console/enums/query_suggestion_resource.py +97 -0
- appwrite_console/enums/region.py +9 -0
- appwrite_console/enums/relation_mutate.py +6 -0
- appwrite_console/enums/relationship_type.py +7 -0
- appwrite_console/enums/runtime.py +95 -0
- appwrite_console/enums/schedule_resource_type.py +7 -0
- appwrite_console/enums/site_template_use_case.py +12 -0
- appwrite_console/enums/smtp_encryption.py +6 -0
- appwrite_console/enums/status.py +4 -0
- appwrite_console/enums/status_code.py +7 -0
- appwrite_console/enums/supabase_migration_resource.py +14 -0
- appwrite_console/enums/tables_db_index_type.py +7 -0
- appwrite_console/enums/template_reference_type.py +6 -0
- appwrite_console/enums/timezone.py +422 -0
- appwrite_console/enums/usage_range.py +6 -0
- appwrite_console/enums/vcs_detection_type.py +5 -0
- appwrite_console/enums/vcs_reference_type.py +6 -0
- appwrite_console/enums/vectors_db_index_type.py +9 -0
- appwrite_console/enums/waf_rule_action.py +8 -0
- appwrite_console/exception.py +7 -0
- appwrite_console/id.py +26 -0
- appwrite_console/input_file.py +21 -0
- appwrite_console/models/__init__.py +803 -0
- appwrite_console/models/activity_event.py +99 -0
- appwrite_console/models/activity_event_list.py +19 -0
- appwrite_console/models/additional_resource.py +30 -0
- appwrite_console/models/addon.py +42 -0
- appwrite_console/models/addon_list.py +19 -0
- appwrite_console/models/addon_price.py +36 -0
- appwrite_console/models/aggregation_breakdown.py +28 -0
- appwrite_console/models/aggregation_team.py +101 -0
- appwrite_console/models/aggregation_team_list.py +19 -0
- appwrite_console/models/algo_argon2.py +24 -0
- appwrite_console/models/algo_bcrypt.py +15 -0
- appwrite_console/models/algo_md5.py +15 -0
- appwrite_console/models/algo_phpass.py +15 -0
- appwrite_console/models/algo_scrypt.py +27 -0
- appwrite_console/models/algo_scrypt_modified.py +24 -0
- appwrite_console/models/algo_sha.py +15 -0
- appwrite_console/models/app.py +91 -0
- appwrite_console/models/app_installation.py +42 -0
- appwrite_console/models/app_installation_list.py +19 -0
- appwrite_console/models/app_key.py +39 -0
- appwrite_console/models/app_key_list.py +19 -0
- appwrite_console/models/app_scope.py +27 -0
- appwrite_console/models/app_scope_list.py +19 -0
- appwrite_console/models/app_secret.py +39 -0
- appwrite_console/models/app_secret_list.py +19 -0
- appwrite_console/models/app_secret_plaintext.py +39 -0
- appwrite_console/models/apps_list.py +19 -0
- appwrite_console/models/attribute_bigint.py +46 -0
- appwrite_console/models/attribute_boolean.py +40 -0
- appwrite_console/models/attribute_datetime.py +43 -0
- appwrite_console/models/attribute_email.py +43 -0
- appwrite_console/models/attribute_enum.py +46 -0
- appwrite_console/models/attribute_float.py +46 -0
- appwrite_console/models/attribute_integer.py +46 -0
- appwrite_console/models/attribute_ip.py +43 -0
- appwrite_console/models/attribute_line.py +40 -0
- appwrite_console/models/attribute_list.py +36 -0
- appwrite_console/models/attribute_longtext.py +43 -0
- appwrite_console/models/attribute_mediumtext.py +43 -0
- appwrite_console/models/attribute_object.py +37 -0
- appwrite_console/models/attribute_point.py +40 -0
- appwrite_console/models/attribute_polygon.py +40 -0
- appwrite_console/models/attribute_relationship.py +55 -0
- appwrite_console/models/attribute_string.py +46 -0
- appwrite_console/models/attribute_text.py +43 -0
- appwrite_console/models/attribute_url.py +43 -0
- appwrite_console/models/attribute_varchar.py +46 -0
- appwrite_console/models/attribute_vector.py +40 -0
- appwrite_console/models/backup_archive.py +48 -0
- appwrite_console/models/backup_archive_list.py +19 -0
- appwrite_console/models/backup_policy.py +48 -0
- appwrite_console/models/backup_policy_list.py +19 -0
- appwrite_console/models/backup_restoration.py +45 -0
- appwrite_console/models/backup_restoration_list.py +19 -0
- appwrite_console/models/base_model.py +27 -0
- appwrite_console/models/billing_address.py +36 -0
- appwrite_console/models/billing_address_list.py +19 -0
- appwrite_console/models/billing_limits.py +36 -0
- appwrite_console/models/billing_plan.py +226 -0
- appwrite_console/models/billing_plan_addon.py +19 -0
- appwrite_console/models/billing_plan_addon_details.py +36 -0
- appwrite_console/models/billing_plan_dedicated_database_limits.py +69 -0
- appwrite_console/models/billing_plan_limits.py +18 -0
- appwrite_console/models/billing_plan_list.py +19 -0
- appwrite_console/models/billing_plan_supported_addons.py +21 -0
- appwrite_console/models/block.py +45 -0
- appwrite_console/models/block_delete.py +19 -0
- appwrite_console/models/block_list.py +19 -0
- appwrite_console/models/branch.py +15 -0
- appwrite_console/models/branch_list.py +19 -0
- appwrite_console/models/bucket.py +54 -0
- appwrite_console/models/bucket_list.py +19 -0
- appwrite_console/models/campaign.py +49 -0
- appwrite_console/models/collection.py +67 -0
- appwrite_console/models/collection_list.py +19 -0
- appwrite_console/models/column_bigint.py +46 -0
- appwrite_console/models/column_boolean.py +40 -0
- appwrite_console/models/column_datetime.py +43 -0
- appwrite_console/models/column_email.py +43 -0
- appwrite_console/models/column_enum.py +46 -0
- appwrite_console/models/column_float.py +46 -0
- appwrite_console/models/column_index.py +42 -0
- appwrite_console/models/column_index_list.py +19 -0
- appwrite_console/models/column_integer.py +46 -0
- appwrite_console/models/column_ip.py +43 -0
- appwrite_console/models/column_line.py +40 -0
- appwrite_console/models/column_list.py +36 -0
- appwrite_console/models/column_longtext.py +43 -0
- appwrite_console/models/column_mediumtext.py +43 -0
- appwrite_console/models/column_point.py +40 -0
- appwrite_console/models/column_polygon.py +40 -0
- appwrite_console/models/column_relationship.py +55 -0
- appwrite_console/models/column_string.py +46 -0
- appwrite_console/models/column_text.py +43 -0
- appwrite_console/models/column_url.py +43 -0
- appwrite_console/models/column_varchar.py +46 -0
- appwrite_console/models/console_key_scope.py +24 -0
- appwrite_console/models/console_key_scope_list.py +19 -0
- appwrite_console/models/console_o_auth2_provider.py +19 -0
- appwrite_console/models/console_o_auth2_provider_list.py +19 -0
- appwrite_console/models/console_o_auth2_provider_parameter.py +24 -0
- appwrite_console/models/console_region.py +30 -0
- appwrite_console/models/console_region_list.py +19 -0
- appwrite_console/models/console_variables.py +96 -0
- appwrite_console/models/continent.py +18 -0
- appwrite_console/models/continent_list.py +19 -0
- appwrite_console/models/country.py +18 -0
- appwrite_console/models/country_list.py +19 -0
- appwrite_console/models/coupon.py +36 -0
- appwrite_console/models/credit.py +45 -0
- appwrite_console/models/credit_available.py +15 -0
- appwrite_console/models/credit_list.py +22 -0
- appwrite_console/models/currency.py +33 -0
- appwrite_console/models/currency_list.py +19 -0
- appwrite_console/models/database.py +52 -0
- appwrite_console/models/database_list.py +19 -0
- appwrite_console/models/database_migration.py +57 -0
- appwrite_console/models/database_migration_list.py +19 -0
- appwrite_console/models/database_status.py +57 -0
- appwrite_console/models/database_status_connections.py +18 -0
- appwrite_console/models/database_status_replica.py +24 -0
- appwrite_console/models/database_status_volume.py +24 -0
- appwrite_console/models/dedicated_database.py +159 -0
- appwrite_console/models/dedicated_database_backup.py +63 -0
- appwrite_console/models/dedicated_database_backup_list.py +19 -0
- appwrite_console/models/dedicated_database_backup_storage.py +27 -0
- appwrite_console/models/dedicated_database_branch.py +48 -0
- appwrite_console/models/dedicated_database_branch_list.py +16 -0
- appwrite_console/models/dedicated_database_execution.py +31 -0
- appwrite_console/models/dedicated_database_execution_column.py +18 -0
- appwrite_console/models/dedicated_database_extensions.py +22 -0
- appwrite_console/models/dedicated_database_list.py +19 -0
- appwrite_console/models/dedicated_database_member.py +24 -0
- appwrite_console/models/dedicated_database_operation.py +45 -0
- appwrite_console/models/dedicated_database_operation_list.py +19 -0
- appwrite_console/models/dedicated_database_pitr_windows.py +18 -0
- appwrite_console/models/dedicated_database_pooler.py +42 -0
- appwrite_console/models/dedicated_database_replicas.py +37 -0
- appwrite_console/models/dedicated_database_restoration.py +45 -0
- appwrite_console/models/dedicated_database_restoration_list.py +19 -0
- appwrite_console/models/dedicated_database_specification.py +39 -0
- appwrite_console/models/dedicated_database_specification_list.py +23 -0
- appwrite_console/models/dedicated_database_specification_pricing.py +27 -0
- appwrite_console/models/deployment.py +94 -0
- appwrite_console/models/deployment_list.py +19 -0
- appwrite_console/models/detection_framework.py +32 -0
- appwrite_console/models/detection_runtime.py +29 -0
- appwrite_console/models/detection_variable.py +18 -0
- appwrite_console/models/dev_key.py +36 -0
- appwrite_console/models/dev_key_list.py +19 -0
- appwrite_console/models/dns_record.py +48 -0
- appwrite_console/models/dns_records_list.py +19 -0
- appwrite_console/models/document.py +80 -0
- appwrite_console/models/document_list.py +32 -0
- appwrite_console/models/domain.py +53 -0
- appwrite_console/models/domain_price.py +30 -0
- appwrite_console/models/domain_purchase.py +43 -0
- appwrite_console/models/domain_suggestion.py +24 -0
- appwrite_console/models/domain_suggestions_list.py +19 -0
- appwrite_console/models/domain_transfer_out.py +15 -0
- appwrite_console/models/domain_transfer_status.py +22 -0
- appwrite_console/models/domains_list.py +19 -0
- appwrite_console/models/downgrade_feedback.py +42 -0
- appwrite_console/models/email_template.py +36 -0
- appwrite_console/models/email_template_list.py +19 -0
- appwrite_console/models/embedding.py +24 -0
- appwrite_console/models/embedding_list.py +19 -0
- appwrite_console/models/ephemeral_key.py +39 -0
- appwrite_console/models/estimation.py +37 -0
- appwrite_console/models/estimation_delete_organization.py +16 -0
- appwrite_console/models/estimation_item.py +18 -0
- appwrite_console/models/estimation_plan_change.py +29 -0
- appwrite_console/models/estimation_update_plan.py +40 -0
- appwrite_console/models/execution.py +69 -0
- appwrite_console/models/execution_list.py +19 -0
- appwrite_console/models/file.py +60 -0
- appwrite_console/models/file_list.py +19 -0
- appwrite_console/models/framework.py +28 -0
- appwrite_console/models/framework_adapter.py +27 -0
- appwrite_console/models/framework_list.py +19 -0
- appwrite_console/models/function.py +109 -0
- appwrite_console/models/function_list.py +19 -0
- appwrite_console/models/headers.py +18 -0
- appwrite_console/models/identity.py +42 -0
- appwrite_console/models/identity_list.py +19 -0
- appwrite_console/models/index.py +43 -0
- appwrite_console/models/index_list.py +19 -0
- appwrite_console/models/insight.py +64 -0
- appwrite_console/models/insight_cta.py +24 -0
- appwrite_console/models/insight_list.py +19 -0
- appwrite_console/models/installation.py +30 -0
- appwrite_console/models/installation_list.py +19 -0
- appwrite_console/models/invoice.py +82 -0
- appwrite_console/models/invoice_list.py +19 -0
- appwrite_console/models/jwt.py +15 -0
- appwrite_console/models/key.py +39 -0
- appwrite_console/models/key_list.py +19 -0
- appwrite_console/models/language.py +21 -0
- appwrite_console/models/language_list.py +19 -0
- appwrite_console/models/locale.py +66 -0
- appwrite_console/models/locale_code.py +18 -0
- appwrite_console/models/locale_code_list.py +19 -0
- appwrite_console/models/log.py +78 -0
- appwrite_console/models/log_list.py +19 -0
- appwrite_console/models/membership.py +57 -0
- appwrite_console/models/membership_list.py +19 -0
- appwrite_console/models/message.py +52 -0
- appwrite_console/models/message_list.py +19 -0
- appwrite_console/models/metric.py +18 -0
- appwrite_console/models/metric_breakdown.py +24 -0
- appwrite_console/models/mfa_challenge.py +24 -0
- appwrite_console/models/mfa_factors.py +24 -0
- appwrite_console/models/mfa_recovery_codes.py +15 -0
- appwrite_console/models/mfa_type.py +18 -0
- appwrite_console/models/migration.py +75 -0
- appwrite_console/models/migration_list.py +19 -0
- appwrite_console/models/migration_report.py +96 -0
- appwrite_console/models/mock_number.py +24 -0
- appwrite_console/models/mock_number_list.py +19 -0
- appwrite_console/models/notification.py +60 -0
- appwrite_console/models/notification_list.py +19 -0
- appwrite_console/models/o_auth2_amazon.py +24 -0
- appwrite_console/models/o_auth2_apple.py +30 -0
- appwrite_console/models/o_auth2_appwrite.py +24 -0
- appwrite_console/models/o_auth2_auth0.py +27 -0
- appwrite_console/models/o_auth2_authentik.py +27 -0
- appwrite_console/models/o_auth2_autodesk.py +24 -0
- appwrite_console/models/o_auth2_bitbucket.py +24 -0
- appwrite_console/models/o_auth2_bitly.py +24 -0
- appwrite_console/models/o_auth2_box.py +24 -0
- appwrite_console/models/o_auth2_dailymotion.py +24 -0
- appwrite_console/models/o_auth2_discord.py +24 -0
- appwrite_console/models/o_auth2_disqus.py +24 -0
- appwrite_console/models/o_auth2_dropbox.py +24 -0
- appwrite_console/models/o_auth2_etsy.py +24 -0
- appwrite_console/models/o_auth2_facebook.py +24 -0
- appwrite_console/models/o_auth2_figma.py +24 -0
- appwrite_console/models/o_auth2_fusion_auth.py +27 -0
- appwrite_console/models/o_auth2_github.py +24 -0
- appwrite_console/models/o_auth2_gitlab.py +27 -0
- appwrite_console/models/o_auth2_google.py +28 -0
- appwrite_console/models/o_auth2_keycloak.py +30 -0
- appwrite_console/models/o_auth2_kick.py +24 -0
- appwrite_console/models/o_auth2_linkedin.py +24 -0
- appwrite_console/models/o_auth2_microsoft.py +27 -0
- appwrite_console/models/o_auth2_notion.py +24 -0
- appwrite_console/models/o_auth2_oidc.py +43 -0
- appwrite_console/models/o_auth2_okta.py +30 -0
- appwrite_console/models/o_auth2_paypal.py +24 -0
- appwrite_console/models/o_auth2_podio.py +24 -0
- appwrite_console/models/o_auth2_provider_list.py +59 -0
- appwrite_console/models/o_auth2_salesforce.py +24 -0
- appwrite_console/models/o_auth2_slack.py +24 -0
- appwrite_console/models/o_auth2_spotify.py +24 -0
- appwrite_console/models/o_auth2_stripe.py +24 -0
- appwrite_console/models/o_auth2_tradeshift.py +24 -0
- appwrite_console/models/o_auth2_twitch.py +24 -0
- appwrite_console/models/o_auth2_word_press.py +24 -0
- appwrite_console/models/o_auth2_x.py +24 -0
- appwrite_console/models/o_auth2_yahoo.py +24 -0
- appwrite_console/models/o_auth2_yandex.py +24 -0
- appwrite_console/models/o_auth2_zoho.py +24 -0
- appwrite_console/models/o_auth2_zoom.py +24 -0
- appwrite_console/models/oauth2_approve.py +15 -0
- appwrite_console/models/oauth2_authorize.py +18 -0
- appwrite_console/models/oauth2_consent.py +42 -0
- appwrite_console/models/oauth2_consent_list.py +19 -0
- appwrite_console/models/oauth2_consent_token.py +45 -0
- appwrite_console/models/oauth2_consent_token_list.py +19 -0
- appwrite_console/models/oauth2_device_authorization.py +30 -0
- appwrite_console/models/oauth2_grant.py +48 -0
- appwrite_console/models/oauth2_organization.py +15 -0
- appwrite_console/models/oauth2_organization_list.py +19 -0
- appwrite_console/models/oauth2_par.py +18 -0
- appwrite_console/models/oauth2_project.py +21 -0
- appwrite_console/models/oauth2_project_list.py +19 -0
- appwrite_console/models/oauth2_reject.py +15 -0
- appwrite_console/models/oauth2_token.py +33 -0
- appwrite_console/models/organization.py +132 -0
- appwrite_console/models/organization_list.py +32 -0
- appwrite_console/models/payment_authentication.py +30 -0
- appwrite_console/models/payment_method.py +72 -0
- appwrite_console/models/payment_method_list.py +19 -0
- appwrite_console/models/phone.py +21 -0
- appwrite_console/models/phone_list.py +19 -0
- appwrite_console/models/plan_change_estimation_details.py +39 -0
- appwrite_console/models/plan_change_limits.py +28 -0
- appwrite_console/models/plan_change_project_compliance.py +28 -0
- appwrite_console/models/plan_change_resource_compliance.py +30 -0
- appwrite_console/models/platform_android.py +31 -0
- appwrite_console/models/platform_apple.py +31 -0
- appwrite_console/models/platform_linux.py +31 -0
- appwrite_console/models/platform_list.py +23 -0
- appwrite_console/models/platform_web.py +31 -0
- appwrite_console/models/platform_windows.py +31 -0
- appwrite_console/models/policy_deny_aliased_email.py +18 -0
- appwrite_console/models/policy_deny_corporate_email.py +18 -0
- appwrite_console/models/policy_deny_disposable_email.py +18 -0
- appwrite_console/models/policy_deny_free_email.py +18 -0
- appwrite_console/models/policy_list.py +32 -0
- appwrite_console/models/policy_membership_privacy.py +33 -0
- appwrite_console/models/policy_password_dictionary.py +18 -0
- appwrite_console/models/policy_password_history.py +18 -0
- appwrite_console/models/policy_password_personal_data.py +18 -0
- appwrite_console/models/policy_password_strength.py +30 -0
- appwrite_console/models/policy_session_alert.py +18 -0
- appwrite_console/models/policy_session_duration.py +18 -0
- appwrite_console/models/policy_session_invalidation.py +18 -0
- appwrite_console/models/policy_session_limit.py +18 -0
- appwrite_console/models/policy_user_limit.py +18 -0
- appwrite_console/models/postgres_extension.py +24 -0
- appwrite_console/models/postgres_extension_list.py +19 -0
- appwrite_console/models/preferences.py +52 -0
- appwrite_console/models/presence.py +39 -0
- appwrite_console/models/presence_list.py +19 -0
- appwrite_console/models/program.py +39 -0
- appwrite_console/models/project.py +153 -0
- appwrite_console/models/project_auth_method.py +19 -0
- appwrite_console/models/project_list.py +19 -0
- appwrite_console/models/project_protocol.py +19 -0
- appwrite_console/models/project_service.py +19 -0
- appwrite_console/models/provider.py +39 -0
- appwrite_console/models/provider_list.py +19 -0
- appwrite_console/models/provider_repository.py +42 -0
- appwrite_console/models/provider_repository_framework.py +45 -0
- appwrite_console/models/provider_repository_framework_list.py +22 -0
- appwrite_console/models/provider_repository_runtime.py +45 -0
- appwrite_console/models/provider_repository_runtime_list.py +22 -0
- appwrite_console/models/proxy_rule.py +59 -0
- appwrite_console/models/proxy_rule_list.py +19 -0
- appwrite_console/models/report.py +49 -0
- appwrite_console/models/report_list.py +19 -0
- appwrite_console/models/resource_token.py +33 -0
- appwrite_console/models/resource_token_list.py +19 -0
- appwrite_console/models/review.py +24 -0
- appwrite_console/models/roles.py +18 -0
- appwrite_console/models/row.py +80 -0
- appwrite_console/models/row_list.py +32 -0
- appwrite_console/models/runtime.py +36 -0
- appwrite_console/models/runtime_list.py +19 -0
- appwrite_console/models/schedule.py +45 -0
- appwrite_console/models/schedule_list.py +19 -0
- appwrite_console/models/session.py +99 -0
- appwrite_console/models/session_list.py +19 -0
- appwrite_console/models/site.py +115 -0
- appwrite_console/models/site_list.py +19 -0
- appwrite_console/models/specification.py +24 -0
- appwrite_console/models/specification_list.py +19 -0
- appwrite_console/models/stage.py +27 -0
- appwrite_console/models/stage_list.py +16 -0
- appwrite_console/models/subscriber.py +40 -0
- appwrite_console/models/subscriber_list.py +19 -0
- appwrite_console/models/table.py +67 -0
- appwrite_console/models/table_list.py +19 -0
- appwrite_console/models/target.py +39 -0
- appwrite_console/models/target_list.py +19 -0
- appwrite_console/models/team.py +43 -0
- appwrite_console/models/team_list.py +32 -0
- appwrite_console/models/template_framework.py +39 -0
- appwrite_console/models/template_function.py +65 -0
- appwrite_console/models/template_function_list.py +19 -0
- appwrite_console/models/template_runtime.py +24 -0
- appwrite_console/models/template_site.py +53 -0
- appwrite_console/models/template_site_list.py +19 -0
- appwrite_console/models/template_variable.py +33 -0
- appwrite_console/models/token.py +30 -0
- appwrite_console/models/topic.py +36 -0
- appwrite_console/models/topic_list.py +19 -0
- appwrite_console/models/transaction.py +30 -0
- appwrite_console/models/transaction_list.py +19 -0
- appwrite_console/models/usage_billing_plan.py +46 -0
- appwrite_console/models/usage_data_point.py +99 -0
- appwrite_console/models/usage_event_list.py +19 -0
- appwrite_console/models/usage_gauge_list.py +19 -0
- appwrite_console/models/usage_metric.py +19 -0
- appwrite_console/models/usage_organization.py +104 -0
- appwrite_console/models/usage_organization_project.py +73 -0
- appwrite_console/models/usage_presence.py +22 -0
- appwrite_console/models/usage_project.py +218 -0
- appwrite_console/models/usage_resources.py +36 -0
- appwrite_console/models/usage_users.py +28 -0
- appwrite_console/models/user.py +111 -0
- appwrite_console/models/user_list.py +32 -0
- appwrite_console/models/variable.py +36 -0
- appwrite_console/models/variable_list.py +19 -0
- appwrite_console/models/vcs_content.py +21 -0
- appwrite_console/models/vcs_content_list.py +19 -0
- appwrite_console/models/vcs_namespace.py +27 -0
- appwrite_console/models/vcs_namespace_list.py +19 -0
- appwrite_console/models/vectorsdb_collection.py +54 -0
- appwrite_console/models/vectorsdb_collection_list.py +19 -0
- appwrite_console/models/waf_rule.py +55 -0
- appwrite_console/models/waf_rule_bypass.py +55 -0
- appwrite_console/models/waf_rule_challenge.py +64 -0
- appwrite_console/models/waf_rule_deny.py +55 -0
- appwrite_console/models/waf_rule_list.py +19 -0
- appwrite_console/models/waf_rule_rate_limit.py +64 -0
- appwrite_console/models/waf_rule_redirect.py +61 -0
- appwrite_console/models/webhook.py +51 -0
- appwrite_console/models/webhook_list.py +19 -0
- appwrite_console/operator.py +150 -0
- appwrite_console/permission.py +21 -0
- appwrite_console/query.py +293 -0
- appwrite_console/role.py +111 -0
- appwrite_console/service.py +50 -0
- appwrite_console/services/__init__.py +1 -0
- appwrite_console/services/account.py +3328 -0
- appwrite_console/services/activities.py +89 -0
- appwrite_console/services/advisor.py +234 -0
- appwrite_console/services/apps.py +1156 -0
- appwrite_console/services/assistant.py +50 -0
- appwrite_console/services/avatars.py +531 -0
- appwrite_console/services/backups.py +572 -0
- appwrite_console/services/console.py +807 -0
- appwrite_console/services/databases.py +4976 -0
- appwrite_console/services/documents_db.py +2052 -0
- appwrite_console/services/domains.py +3047 -0
- appwrite_console/services/functions.py +1659 -0
- appwrite_console/services/graphql.py +92 -0
- appwrite_console/services/locale.py +243 -0
- appwrite_console/services/manager.py +301 -0
- appwrite_console/services/messaging.py +3137 -0
- appwrite_console/services/migrations.py +1036 -0
- appwrite_console/services/mongo.py +1683 -0
- appwrite_console/services/mysql.py +1861 -0
- appwrite_console/services/notifications.py +98 -0
- appwrite_console/services/oauth2.py +914 -0
- appwrite_console/services/organization.py +1039 -0
- appwrite_console/services/organizations.py +2245 -0
- appwrite_console/services/postgresql.py +1995 -0
- appwrite_console/services/presences.py +309 -0
- appwrite_console/services/project.py +5271 -0
- appwrite_console/services/projects.py +885 -0
- appwrite_console/services/proxy.py +394 -0
- appwrite_console/services/sites.py +1593 -0
- appwrite_console/services/storage.py +818 -0
- appwrite_console/services/tables_db.py +5189 -0
- appwrite_console/services/teams.py +993 -0
- appwrite_console/services/tokens.py +243 -0
- appwrite_console/services/usage.py +194 -0
- appwrite_console/services/users.py +2314 -0
- appwrite_console/services/vcs.py +599 -0
- appwrite_console/services/vectors_db.py +2054 -0
- appwrite_console/services/waf.py +1014 -0
- appwrite_console/services/webhooks.py +344 -0
- appwrite_console/utils/__init__.py +1 -0
- appwrite_console/utils/deprecated.py +51 -0
- appwrite_console-0.1.0.dist-info/METADATA +189 -0
- appwrite_console-0.1.0.dist-info/RECORD +552 -0
- appwrite_console-0.1.0.dist-info/WHEEL +5 -0
- appwrite_console-0.1.0.dist-info/licenses/LICENSE +12 -0
- appwrite_console-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,1593 @@
|
|
|
1
|
+
from ..service import Service
|
|
2
|
+
from urllib.parse import quote
|
|
3
|
+
from typing import Any, Dict, List, Optional, Union
|
|
4
|
+
from ..exception import AppwriteException
|
|
5
|
+
from appwrite_console.utils.deprecated import deprecated
|
|
6
|
+
from ..models.site_list import SiteList
|
|
7
|
+
from ..enums.framework import Framework
|
|
8
|
+
from ..enums.build_runtime import BuildRuntime
|
|
9
|
+
from ..enums.adapter import Adapter
|
|
10
|
+
from ..models.site import Site
|
|
11
|
+
from ..models.framework_list import FrameworkList
|
|
12
|
+
from ..models.specification_list import SpecificationList
|
|
13
|
+
from ..enums.site_template_use_case import SiteTemplateUseCase
|
|
14
|
+
from ..models.template_site_list import TemplateSiteList
|
|
15
|
+
from ..models.template_site import TemplateSite
|
|
16
|
+
from ..models.deployment_list import DeploymentList
|
|
17
|
+
from ..input_file import InputFile
|
|
18
|
+
from ..models.deployment import Deployment
|
|
19
|
+
from ..enums.template_reference_type import TemplateReferenceType
|
|
20
|
+
from ..enums.vcs_reference_type import VCSReferenceType
|
|
21
|
+
from ..enums.deployment_download_type import DeploymentDownloadType
|
|
22
|
+
from ..models.execution_list import ExecutionList
|
|
23
|
+
from ..models.execution import Execution
|
|
24
|
+
from ..models.variable_list import VariableList
|
|
25
|
+
from ..models.variable import Variable
|
|
26
|
+
|
|
27
|
+
class Sites(Service):
|
|
28
|
+
|
|
29
|
+
def __init__(self, client) -> None:
|
|
30
|
+
super(Sites, self).__init__(client)
|
|
31
|
+
|
|
32
|
+
def list(
|
|
33
|
+
self,
|
|
34
|
+
queries: Optional[List[str]] = None,
|
|
35
|
+
search: Optional[str] = None,
|
|
36
|
+
total: Optional[bool] = None
|
|
37
|
+
) -> SiteList:
|
|
38
|
+
"""
|
|
39
|
+
Get a list of all the project's sites. You can use the query params to filter your results.
|
|
40
|
+
|
|
41
|
+
Parameters
|
|
42
|
+
----------
|
|
43
|
+
queries : Optional[List[str]]
|
|
44
|
+
Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId
|
|
45
|
+
search : Optional[str]
|
|
46
|
+
Search term to filter your list results. Max length: 256 chars.
|
|
47
|
+
total : Optional[bool]
|
|
48
|
+
When set to false, the total count returned will be 0 and will not be calculated.
|
|
49
|
+
|
|
50
|
+
Returns
|
|
51
|
+
-------
|
|
52
|
+
SiteList
|
|
53
|
+
API response as a typed Pydantic model
|
|
54
|
+
|
|
55
|
+
Raises
|
|
56
|
+
------
|
|
57
|
+
AppwriteException
|
|
58
|
+
If API request fails
|
|
59
|
+
"""
|
|
60
|
+
|
|
61
|
+
api_path = '/sites'
|
|
62
|
+
api_params = {}
|
|
63
|
+
|
|
64
|
+
if queries is not None:
|
|
65
|
+
api_params['queries'] = self._normalize_value(queries)
|
|
66
|
+
if search is not None:
|
|
67
|
+
api_params['search'] = self._normalize_value(search)
|
|
68
|
+
if total is not None:
|
|
69
|
+
api_params['total'] = self._normalize_value(total)
|
|
70
|
+
|
|
71
|
+
response = self.client.call('get', api_path, {
|
|
72
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
73
|
+
'accept': 'application/json',
|
|
74
|
+
}, api_params)
|
|
75
|
+
|
|
76
|
+
return self._parse_response(response, model=SiteList)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def create(
|
|
80
|
+
self,
|
|
81
|
+
site_id: str,
|
|
82
|
+
name: str,
|
|
83
|
+
framework: Framework,
|
|
84
|
+
build_runtime: BuildRuntime,
|
|
85
|
+
enabled: Optional[bool] = None,
|
|
86
|
+
logging: Optional[bool] = None,
|
|
87
|
+
timeout: Optional[float] = None,
|
|
88
|
+
install_command: Optional[str] = None,
|
|
89
|
+
build_command: Optional[str] = None,
|
|
90
|
+
start_command: Optional[str] = None,
|
|
91
|
+
output_directory: Optional[str] = None,
|
|
92
|
+
adapter: Optional[Adapter] = None,
|
|
93
|
+
installation_id: Optional[str] = None,
|
|
94
|
+
fallback_file: Optional[str] = None,
|
|
95
|
+
provider_repository_id: Optional[str] = None,
|
|
96
|
+
provider_branch: Optional[str] = None,
|
|
97
|
+
provider_silent_mode: Optional[bool] = None,
|
|
98
|
+
provider_root_directory: Optional[str] = None,
|
|
99
|
+
provider_branches: Optional[List[str]] = None,
|
|
100
|
+
provider_paths: Optional[List[str]] = None,
|
|
101
|
+
build_specification: Optional[str] = None,
|
|
102
|
+
runtime_specification: Optional[str] = None,
|
|
103
|
+
deployment_retention: Optional[float] = None
|
|
104
|
+
) -> Site:
|
|
105
|
+
"""
|
|
106
|
+
Create a new site.
|
|
107
|
+
|
|
108
|
+
Parameters
|
|
109
|
+
----------
|
|
110
|
+
site_id : str
|
|
111
|
+
Site ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
112
|
+
name : str
|
|
113
|
+
Site name. Max length: 128 chars.
|
|
114
|
+
framework : Framework
|
|
115
|
+
Sites framework.
|
|
116
|
+
build_runtime : BuildRuntime
|
|
117
|
+
Runtime to use during build step.
|
|
118
|
+
enabled : Optional[bool]
|
|
119
|
+
Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
|
120
|
+
logging : Optional[bool]
|
|
121
|
+
When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
|
122
|
+
timeout : Optional[float]
|
|
123
|
+
Maximum request time in seconds.
|
|
124
|
+
install_command : Optional[str]
|
|
125
|
+
Install Command.
|
|
126
|
+
build_command : Optional[str]
|
|
127
|
+
Build Command.
|
|
128
|
+
start_command : Optional[str]
|
|
129
|
+
Custom start command. Leave empty to use default.
|
|
130
|
+
output_directory : Optional[str]
|
|
131
|
+
Output Directory for site.
|
|
132
|
+
adapter : Optional[Adapter]
|
|
133
|
+
Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
|
134
|
+
installation_id : Optional[str]
|
|
135
|
+
Appwrite Installation ID for VCS (Version Control System) deployment.
|
|
136
|
+
fallback_file : Optional[str]
|
|
137
|
+
Fallback file for single page application sites.
|
|
138
|
+
provider_repository_id : Optional[str]
|
|
139
|
+
Repository ID of the repo linked to the site.
|
|
140
|
+
provider_branch : Optional[str]
|
|
141
|
+
Production branch for the repo linked to the site.
|
|
142
|
+
provider_silent_mode : Optional[bool]
|
|
143
|
+
Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
|
144
|
+
provider_root_directory : Optional[str]
|
|
145
|
+
Path to site code in the linked repo.
|
|
146
|
+
provider_branches : Optional[List[str]]
|
|
147
|
+
List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.
|
|
148
|
+
provider_paths : Optional[List[str]]
|
|
149
|
+
List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
|
|
150
|
+
build_specification : Optional[str]
|
|
151
|
+
Build specification for the site deployments.
|
|
152
|
+
runtime_specification : Optional[str]
|
|
153
|
+
Runtime specification for the SSR executions.
|
|
154
|
+
deployment_retention : Optional[float]
|
|
155
|
+
Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
|
|
156
|
+
|
|
157
|
+
Returns
|
|
158
|
+
-------
|
|
159
|
+
Site
|
|
160
|
+
API response as a typed Pydantic model
|
|
161
|
+
|
|
162
|
+
Raises
|
|
163
|
+
------
|
|
164
|
+
AppwriteException
|
|
165
|
+
If API request fails
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
api_path = '/sites'
|
|
169
|
+
api_params = {}
|
|
170
|
+
if site_id is None:
|
|
171
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
172
|
+
|
|
173
|
+
if name is None:
|
|
174
|
+
raise AppwriteException('Missing required parameter: "name"')
|
|
175
|
+
|
|
176
|
+
if framework is None:
|
|
177
|
+
raise AppwriteException('Missing required parameter: "framework"')
|
|
178
|
+
|
|
179
|
+
if build_runtime is None:
|
|
180
|
+
raise AppwriteException('Missing required parameter: "build_runtime"')
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
api_params['siteId'] = self._normalize_value(site_id)
|
|
184
|
+
api_params['name'] = self._normalize_value(name)
|
|
185
|
+
api_params['framework'] = self._normalize_value(framework)
|
|
186
|
+
if enabled is not None:
|
|
187
|
+
api_params['enabled'] = self._normalize_value(enabled)
|
|
188
|
+
if logging is not None:
|
|
189
|
+
api_params['logging'] = self._normalize_value(logging)
|
|
190
|
+
if timeout is not None:
|
|
191
|
+
api_params['timeout'] = self._normalize_value(timeout)
|
|
192
|
+
if install_command is not None:
|
|
193
|
+
api_params['installCommand'] = self._normalize_value(install_command)
|
|
194
|
+
if build_command is not None:
|
|
195
|
+
api_params['buildCommand'] = self._normalize_value(build_command)
|
|
196
|
+
if start_command is not None:
|
|
197
|
+
api_params['startCommand'] = self._normalize_value(start_command)
|
|
198
|
+
if output_directory is not None:
|
|
199
|
+
api_params['outputDirectory'] = self._normalize_value(output_directory)
|
|
200
|
+
api_params['buildRuntime'] = self._normalize_value(build_runtime)
|
|
201
|
+
if adapter is not None:
|
|
202
|
+
api_params['adapter'] = self._normalize_value(adapter)
|
|
203
|
+
if installation_id is not None:
|
|
204
|
+
api_params['installationId'] = self._normalize_value(installation_id)
|
|
205
|
+
if fallback_file is not None:
|
|
206
|
+
api_params['fallbackFile'] = self._normalize_value(fallback_file)
|
|
207
|
+
if provider_repository_id is not None:
|
|
208
|
+
api_params['providerRepositoryId'] = self._normalize_value(provider_repository_id)
|
|
209
|
+
if provider_branch is not None:
|
|
210
|
+
api_params['providerBranch'] = self._normalize_value(provider_branch)
|
|
211
|
+
if provider_silent_mode is not None:
|
|
212
|
+
api_params['providerSilentMode'] = self._normalize_value(provider_silent_mode)
|
|
213
|
+
if provider_root_directory is not None:
|
|
214
|
+
api_params['providerRootDirectory'] = self._normalize_value(provider_root_directory)
|
|
215
|
+
if provider_branches is not None:
|
|
216
|
+
api_params['providerBranches'] = self._normalize_value(provider_branches)
|
|
217
|
+
if provider_paths is not None:
|
|
218
|
+
api_params['providerPaths'] = self._normalize_value(provider_paths)
|
|
219
|
+
if build_specification is not None:
|
|
220
|
+
api_params['buildSpecification'] = self._normalize_value(build_specification)
|
|
221
|
+
if runtime_specification is not None:
|
|
222
|
+
api_params['runtimeSpecification'] = self._normalize_value(runtime_specification)
|
|
223
|
+
if deployment_retention is not None:
|
|
224
|
+
api_params['deploymentRetention'] = self._normalize_value(deployment_retention)
|
|
225
|
+
|
|
226
|
+
response = self.client.call('post', api_path, {
|
|
227
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
228
|
+
'content-type': 'application/json',
|
|
229
|
+
'accept': 'application/json',
|
|
230
|
+
}, api_params)
|
|
231
|
+
|
|
232
|
+
return self._parse_response(response, model=Site)
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def list_frameworks(
|
|
236
|
+
self
|
|
237
|
+
) -> FrameworkList:
|
|
238
|
+
"""
|
|
239
|
+
Get a list of all frameworks that are currently available on the server instance.
|
|
240
|
+
|
|
241
|
+
Returns
|
|
242
|
+
-------
|
|
243
|
+
FrameworkList
|
|
244
|
+
API response as a typed Pydantic model
|
|
245
|
+
|
|
246
|
+
Raises
|
|
247
|
+
------
|
|
248
|
+
AppwriteException
|
|
249
|
+
If API request fails
|
|
250
|
+
"""
|
|
251
|
+
|
|
252
|
+
api_path = '/sites/frameworks'
|
|
253
|
+
api_params = {}
|
|
254
|
+
|
|
255
|
+
response = self.client.call('get', api_path, {
|
|
256
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
257
|
+
'accept': 'application/json',
|
|
258
|
+
}, api_params)
|
|
259
|
+
|
|
260
|
+
return self._parse_response(response, model=FrameworkList)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
def list_specifications(
|
|
264
|
+
self,
|
|
265
|
+
type: Optional[str] = None
|
|
266
|
+
) -> SpecificationList:
|
|
267
|
+
"""
|
|
268
|
+
List allowed site specifications for this instance.
|
|
269
|
+
|
|
270
|
+
Parameters
|
|
271
|
+
----------
|
|
272
|
+
type : Optional[str]
|
|
273
|
+
Specification type to list. Can be one of: runtimes, builds.
|
|
274
|
+
|
|
275
|
+
Returns
|
|
276
|
+
-------
|
|
277
|
+
SpecificationList
|
|
278
|
+
API response as a typed Pydantic model
|
|
279
|
+
|
|
280
|
+
Raises
|
|
281
|
+
------
|
|
282
|
+
AppwriteException
|
|
283
|
+
If API request fails
|
|
284
|
+
"""
|
|
285
|
+
|
|
286
|
+
api_path = '/sites/specifications'
|
|
287
|
+
api_params = {}
|
|
288
|
+
|
|
289
|
+
if type is not None:
|
|
290
|
+
api_params['type'] = self._normalize_value(type)
|
|
291
|
+
|
|
292
|
+
response = self.client.call('get', api_path, {
|
|
293
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
294
|
+
'accept': 'application/json',
|
|
295
|
+
}, api_params)
|
|
296
|
+
|
|
297
|
+
return self._parse_response(response, model=SpecificationList)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
def list_templates(
|
|
301
|
+
self,
|
|
302
|
+
frameworks: Optional[List[Framework]] = None,
|
|
303
|
+
use_cases: Optional[List[SiteTemplateUseCase]] = None,
|
|
304
|
+
limit: Optional[float] = None,
|
|
305
|
+
offset: Optional[float] = None
|
|
306
|
+
) -> TemplateSiteList:
|
|
307
|
+
"""
|
|
308
|
+
List available site templates. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.
|
|
309
|
+
|
|
310
|
+
Parameters
|
|
311
|
+
----------
|
|
312
|
+
frameworks : Optional[List[Framework]]
|
|
313
|
+
List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.
|
|
314
|
+
use_cases : Optional[List[SiteTemplateUseCase]]
|
|
315
|
+
List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.
|
|
316
|
+
limit : Optional[float]
|
|
317
|
+
Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
|
|
318
|
+
offset : Optional[float]
|
|
319
|
+
Offset the list of returned templates. Maximum offset is 5000.
|
|
320
|
+
|
|
321
|
+
Returns
|
|
322
|
+
-------
|
|
323
|
+
TemplateSiteList
|
|
324
|
+
API response as a typed Pydantic model
|
|
325
|
+
|
|
326
|
+
Raises
|
|
327
|
+
------
|
|
328
|
+
AppwriteException
|
|
329
|
+
If API request fails
|
|
330
|
+
"""
|
|
331
|
+
|
|
332
|
+
api_path = '/sites/templates'
|
|
333
|
+
api_params = {}
|
|
334
|
+
|
|
335
|
+
if frameworks is not None:
|
|
336
|
+
api_params['frameworks'] = self._normalize_value(frameworks)
|
|
337
|
+
if use_cases is not None:
|
|
338
|
+
api_params['useCases'] = self._normalize_value(use_cases)
|
|
339
|
+
if limit is not None:
|
|
340
|
+
api_params['limit'] = self._normalize_value(limit)
|
|
341
|
+
if offset is not None:
|
|
342
|
+
api_params['offset'] = self._normalize_value(offset)
|
|
343
|
+
|
|
344
|
+
response = self.client.call('get', api_path, {
|
|
345
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
346
|
+
'accept': 'application/json',
|
|
347
|
+
}, api_params)
|
|
348
|
+
|
|
349
|
+
return self._parse_response(response, model=TemplateSiteList)
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
def get_template(
|
|
353
|
+
self,
|
|
354
|
+
template_id: str
|
|
355
|
+
) -> TemplateSite:
|
|
356
|
+
"""
|
|
357
|
+
Get a site template using ID. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.
|
|
358
|
+
|
|
359
|
+
Parameters
|
|
360
|
+
----------
|
|
361
|
+
template_id : str
|
|
362
|
+
Template ID.
|
|
363
|
+
|
|
364
|
+
Returns
|
|
365
|
+
-------
|
|
366
|
+
TemplateSite
|
|
367
|
+
API response as a typed Pydantic model
|
|
368
|
+
|
|
369
|
+
Raises
|
|
370
|
+
------
|
|
371
|
+
AppwriteException
|
|
372
|
+
If API request fails
|
|
373
|
+
"""
|
|
374
|
+
|
|
375
|
+
api_path = '/sites/templates/{templateId}'
|
|
376
|
+
api_params = {}
|
|
377
|
+
if template_id is None:
|
|
378
|
+
raise AppwriteException('Missing required parameter: "template_id"')
|
|
379
|
+
|
|
380
|
+
api_path = api_path.replace('{templateId}', str(self._normalize_value(template_id)))
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
response = self.client.call('get', api_path, {
|
|
384
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
385
|
+
'accept': 'application/json',
|
|
386
|
+
}, api_params)
|
|
387
|
+
|
|
388
|
+
return self._parse_response(response, model=TemplateSite)
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
def get(
|
|
392
|
+
self,
|
|
393
|
+
site_id: str
|
|
394
|
+
) -> Site:
|
|
395
|
+
"""
|
|
396
|
+
Get a site by its unique ID.
|
|
397
|
+
|
|
398
|
+
Parameters
|
|
399
|
+
----------
|
|
400
|
+
site_id : str
|
|
401
|
+
Site ID.
|
|
402
|
+
|
|
403
|
+
Returns
|
|
404
|
+
-------
|
|
405
|
+
Site
|
|
406
|
+
API response as a typed Pydantic model
|
|
407
|
+
|
|
408
|
+
Raises
|
|
409
|
+
------
|
|
410
|
+
AppwriteException
|
|
411
|
+
If API request fails
|
|
412
|
+
"""
|
|
413
|
+
|
|
414
|
+
api_path = '/sites/{siteId}'
|
|
415
|
+
api_params = {}
|
|
416
|
+
if site_id is None:
|
|
417
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
418
|
+
|
|
419
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
response = self.client.call('get', api_path, {
|
|
423
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
424
|
+
'accept': 'application/json',
|
|
425
|
+
}, api_params)
|
|
426
|
+
|
|
427
|
+
return self._parse_response(response, model=Site)
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
def update(
|
|
431
|
+
self,
|
|
432
|
+
site_id: str,
|
|
433
|
+
name: str,
|
|
434
|
+
framework: Framework,
|
|
435
|
+
enabled: Optional[bool] = None,
|
|
436
|
+
logging: Optional[bool] = None,
|
|
437
|
+
timeout: Optional[float] = None,
|
|
438
|
+
install_command: Optional[str] = None,
|
|
439
|
+
build_command: Optional[str] = None,
|
|
440
|
+
start_command: Optional[str] = None,
|
|
441
|
+
output_directory: Optional[str] = None,
|
|
442
|
+
build_runtime: Optional[BuildRuntime] = None,
|
|
443
|
+
adapter: Optional[Adapter] = None,
|
|
444
|
+
fallback_file: Optional[str] = None,
|
|
445
|
+
installation_id: Optional[str] = None,
|
|
446
|
+
provider_repository_id: Optional[str] = None,
|
|
447
|
+
provider_branch: Optional[str] = None,
|
|
448
|
+
provider_silent_mode: Optional[bool] = None,
|
|
449
|
+
provider_root_directory: Optional[str] = None,
|
|
450
|
+
provider_branches: Optional[List[str]] = None,
|
|
451
|
+
provider_paths: Optional[List[str]] = None,
|
|
452
|
+
build_specification: Optional[str] = None,
|
|
453
|
+
runtime_specification: Optional[str] = None,
|
|
454
|
+
deployment_retention: Optional[float] = None
|
|
455
|
+
) -> Site:
|
|
456
|
+
"""
|
|
457
|
+
Update site by its unique ID.
|
|
458
|
+
|
|
459
|
+
Parameters
|
|
460
|
+
----------
|
|
461
|
+
site_id : str
|
|
462
|
+
Site ID.
|
|
463
|
+
name : str
|
|
464
|
+
Site name. Max length: 128 chars.
|
|
465
|
+
framework : Framework
|
|
466
|
+
Sites framework.
|
|
467
|
+
enabled : Optional[bool]
|
|
468
|
+
Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
|
|
469
|
+
logging : Optional[bool]
|
|
470
|
+
When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
|
|
471
|
+
timeout : Optional[float]
|
|
472
|
+
Maximum request time in seconds.
|
|
473
|
+
install_command : Optional[str]
|
|
474
|
+
Install Command.
|
|
475
|
+
build_command : Optional[str]
|
|
476
|
+
Build Command.
|
|
477
|
+
start_command : Optional[str]
|
|
478
|
+
Custom start command. Leave empty to use default.
|
|
479
|
+
output_directory : Optional[str]
|
|
480
|
+
Output Directory for site.
|
|
481
|
+
build_runtime : Optional[BuildRuntime]
|
|
482
|
+
Runtime to use during build step.
|
|
483
|
+
adapter : Optional[Adapter]
|
|
484
|
+
Framework adapter defining rendering strategy. Allowed values are: static, ssr
|
|
485
|
+
fallback_file : Optional[str]
|
|
486
|
+
Fallback file for single page application sites.
|
|
487
|
+
installation_id : Optional[str]
|
|
488
|
+
Appwrite Installation ID for VCS (Version Control System) deployment.
|
|
489
|
+
provider_repository_id : Optional[str]
|
|
490
|
+
Repository ID of the repo linked to the site.
|
|
491
|
+
provider_branch : Optional[str]
|
|
492
|
+
Production branch for the repo linked to the site.
|
|
493
|
+
provider_silent_mode : Optional[bool]
|
|
494
|
+
Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
|
|
495
|
+
provider_root_directory : Optional[str]
|
|
496
|
+
Path to site code in the linked repo.
|
|
497
|
+
provider_branches : Optional[List[str]]
|
|
498
|
+
List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.
|
|
499
|
+
provider_paths : Optional[List[str]]
|
|
500
|
+
List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
|
|
501
|
+
build_specification : Optional[str]
|
|
502
|
+
Build specification for the site deployments.
|
|
503
|
+
runtime_specification : Optional[str]
|
|
504
|
+
Runtime specification for the SSR executions.
|
|
505
|
+
deployment_retention : Optional[float]
|
|
506
|
+
Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
|
|
507
|
+
|
|
508
|
+
Returns
|
|
509
|
+
-------
|
|
510
|
+
Site
|
|
511
|
+
API response as a typed Pydantic model
|
|
512
|
+
|
|
513
|
+
Raises
|
|
514
|
+
------
|
|
515
|
+
AppwriteException
|
|
516
|
+
If API request fails
|
|
517
|
+
"""
|
|
518
|
+
|
|
519
|
+
api_path = '/sites/{siteId}'
|
|
520
|
+
api_params = {}
|
|
521
|
+
if site_id is None:
|
|
522
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
523
|
+
|
|
524
|
+
if name is None:
|
|
525
|
+
raise AppwriteException('Missing required parameter: "name"')
|
|
526
|
+
|
|
527
|
+
if framework is None:
|
|
528
|
+
raise AppwriteException('Missing required parameter: "framework"')
|
|
529
|
+
|
|
530
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
531
|
+
|
|
532
|
+
api_params['name'] = self._normalize_value(name)
|
|
533
|
+
api_params['framework'] = self._normalize_value(framework)
|
|
534
|
+
if enabled is not None:
|
|
535
|
+
api_params['enabled'] = self._normalize_value(enabled)
|
|
536
|
+
if logging is not None:
|
|
537
|
+
api_params['logging'] = self._normalize_value(logging)
|
|
538
|
+
if timeout is not None:
|
|
539
|
+
api_params['timeout'] = self._normalize_value(timeout)
|
|
540
|
+
if install_command is not None:
|
|
541
|
+
api_params['installCommand'] = self._normalize_value(install_command)
|
|
542
|
+
if build_command is not None:
|
|
543
|
+
api_params['buildCommand'] = self._normalize_value(build_command)
|
|
544
|
+
if start_command is not None:
|
|
545
|
+
api_params['startCommand'] = self._normalize_value(start_command)
|
|
546
|
+
if output_directory is not None:
|
|
547
|
+
api_params['outputDirectory'] = self._normalize_value(output_directory)
|
|
548
|
+
if build_runtime is not None:
|
|
549
|
+
api_params['buildRuntime'] = self._normalize_value(build_runtime)
|
|
550
|
+
if adapter is not None:
|
|
551
|
+
api_params['adapter'] = self._normalize_value(adapter)
|
|
552
|
+
if fallback_file is not None:
|
|
553
|
+
api_params['fallbackFile'] = self._normalize_value(fallback_file)
|
|
554
|
+
if installation_id is not None:
|
|
555
|
+
api_params['installationId'] = self._normalize_value(installation_id)
|
|
556
|
+
if provider_repository_id is not None:
|
|
557
|
+
api_params['providerRepositoryId'] = self._normalize_value(provider_repository_id)
|
|
558
|
+
if provider_branch is not None:
|
|
559
|
+
api_params['providerBranch'] = self._normalize_value(provider_branch)
|
|
560
|
+
if provider_silent_mode is not None:
|
|
561
|
+
api_params['providerSilentMode'] = self._normalize_value(provider_silent_mode)
|
|
562
|
+
if provider_root_directory is not None:
|
|
563
|
+
api_params['providerRootDirectory'] = self._normalize_value(provider_root_directory)
|
|
564
|
+
if provider_branches is not None:
|
|
565
|
+
api_params['providerBranches'] = self._normalize_value(provider_branches)
|
|
566
|
+
if provider_paths is not None:
|
|
567
|
+
api_params['providerPaths'] = self._normalize_value(provider_paths)
|
|
568
|
+
if build_specification is not None:
|
|
569
|
+
api_params['buildSpecification'] = self._normalize_value(build_specification)
|
|
570
|
+
if runtime_specification is not None:
|
|
571
|
+
api_params['runtimeSpecification'] = self._normalize_value(runtime_specification)
|
|
572
|
+
if deployment_retention is not None:
|
|
573
|
+
api_params['deploymentRetention'] = self._normalize_value(deployment_retention)
|
|
574
|
+
|
|
575
|
+
response = self.client.call('put', api_path, {
|
|
576
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
577
|
+
'content-type': 'application/json',
|
|
578
|
+
'accept': 'application/json',
|
|
579
|
+
}, api_params)
|
|
580
|
+
|
|
581
|
+
return self._parse_response(response, model=Site)
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
def delete(
|
|
585
|
+
self,
|
|
586
|
+
site_id: str
|
|
587
|
+
) -> Dict[str, Any]:
|
|
588
|
+
"""
|
|
589
|
+
Delete a site by its unique ID.
|
|
590
|
+
|
|
591
|
+
Parameters
|
|
592
|
+
----------
|
|
593
|
+
site_id : str
|
|
594
|
+
Site ID.
|
|
595
|
+
|
|
596
|
+
Returns
|
|
597
|
+
-------
|
|
598
|
+
Dict[str, Any]
|
|
599
|
+
API response as a dictionary
|
|
600
|
+
|
|
601
|
+
Raises
|
|
602
|
+
------
|
|
603
|
+
AppwriteException
|
|
604
|
+
If API request fails
|
|
605
|
+
"""
|
|
606
|
+
|
|
607
|
+
api_path = '/sites/{siteId}'
|
|
608
|
+
api_params = {}
|
|
609
|
+
if site_id is None:
|
|
610
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
611
|
+
|
|
612
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
response = self.client.call('delete', api_path, {
|
|
616
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
617
|
+
'content-type': 'application/json',
|
|
618
|
+
}, api_params)
|
|
619
|
+
|
|
620
|
+
return response
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
def update_site_deployment(
|
|
624
|
+
self,
|
|
625
|
+
site_id: str,
|
|
626
|
+
deployment_id: str
|
|
627
|
+
) -> Site:
|
|
628
|
+
"""
|
|
629
|
+
Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.
|
|
630
|
+
|
|
631
|
+
Parameters
|
|
632
|
+
----------
|
|
633
|
+
site_id : str
|
|
634
|
+
Site ID.
|
|
635
|
+
deployment_id : str
|
|
636
|
+
Deployment ID.
|
|
637
|
+
|
|
638
|
+
Returns
|
|
639
|
+
-------
|
|
640
|
+
Site
|
|
641
|
+
API response as a typed Pydantic model
|
|
642
|
+
|
|
643
|
+
Raises
|
|
644
|
+
------
|
|
645
|
+
AppwriteException
|
|
646
|
+
If API request fails
|
|
647
|
+
"""
|
|
648
|
+
|
|
649
|
+
api_path = '/sites/{siteId}/deployment'
|
|
650
|
+
api_params = {}
|
|
651
|
+
if site_id is None:
|
|
652
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
653
|
+
|
|
654
|
+
if deployment_id is None:
|
|
655
|
+
raise AppwriteException('Missing required parameter: "deployment_id"')
|
|
656
|
+
|
|
657
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
658
|
+
|
|
659
|
+
api_params['deploymentId'] = self._normalize_value(deployment_id)
|
|
660
|
+
|
|
661
|
+
response = self.client.call('patch', api_path, {
|
|
662
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
663
|
+
'content-type': 'application/json',
|
|
664
|
+
'accept': 'application/json',
|
|
665
|
+
}, api_params)
|
|
666
|
+
|
|
667
|
+
return self._parse_response(response, model=Site)
|
|
668
|
+
|
|
669
|
+
|
|
670
|
+
def list_deployments(
|
|
671
|
+
self,
|
|
672
|
+
site_id: str,
|
|
673
|
+
queries: Optional[List[str]] = None,
|
|
674
|
+
search: Optional[str] = None,
|
|
675
|
+
total: Optional[bool] = None
|
|
676
|
+
) -> DeploymentList:
|
|
677
|
+
"""
|
|
678
|
+
Get a list of all the site's code deployments. You can use the query params to filter your results.
|
|
679
|
+
|
|
680
|
+
Parameters
|
|
681
|
+
----------
|
|
682
|
+
site_id : str
|
|
683
|
+
Site ID.
|
|
684
|
+
queries : Optional[List[str]]
|
|
685
|
+
Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
|
|
686
|
+
search : Optional[str]
|
|
687
|
+
Search term to filter your list results. Max length: 256 chars.
|
|
688
|
+
total : Optional[bool]
|
|
689
|
+
When set to false, the total count returned will be 0 and will not be calculated.
|
|
690
|
+
|
|
691
|
+
Returns
|
|
692
|
+
-------
|
|
693
|
+
DeploymentList
|
|
694
|
+
API response as a typed Pydantic model
|
|
695
|
+
|
|
696
|
+
Raises
|
|
697
|
+
------
|
|
698
|
+
AppwriteException
|
|
699
|
+
If API request fails
|
|
700
|
+
"""
|
|
701
|
+
|
|
702
|
+
api_path = '/sites/{siteId}/deployments'
|
|
703
|
+
api_params = {}
|
|
704
|
+
if site_id is None:
|
|
705
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
706
|
+
|
|
707
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
708
|
+
|
|
709
|
+
if queries is not None:
|
|
710
|
+
api_params['queries'] = self._normalize_value(queries)
|
|
711
|
+
if search is not None:
|
|
712
|
+
api_params['search'] = self._normalize_value(search)
|
|
713
|
+
if total is not None:
|
|
714
|
+
api_params['total'] = self._normalize_value(total)
|
|
715
|
+
|
|
716
|
+
response = self.client.call('get', api_path, {
|
|
717
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
718
|
+
'accept': 'application/json',
|
|
719
|
+
}, api_params)
|
|
720
|
+
|
|
721
|
+
return self._parse_response(response, model=DeploymentList)
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
def create_deployment(
|
|
725
|
+
self,
|
|
726
|
+
site_id: str,
|
|
727
|
+
code: InputFile,
|
|
728
|
+
install_command: Optional[str] = None,
|
|
729
|
+
build_command: Optional[str] = None,
|
|
730
|
+
output_directory: Optional[str] = None,
|
|
731
|
+
activate: Optional[bool] = None,
|
|
732
|
+
on_progress = None
|
|
733
|
+
) -> Deployment:
|
|
734
|
+
"""
|
|
735
|
+
Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.
|
|
736
|
+
|
|
737
|
+
Parameters
|
|
738
|
+
----------
|
|
739
|
+
site_id : str
|
|
740
|
+
Site ID.
|
|
741
|
+
code : InputFile
|
|
742
|
+
Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
|
|
743
|
+
install_command : Optional[str]
|
|
744
|
+
Install Commands.
|
|
745
|
+
build_command : Optional[str]
|
|
746
|
+
Build Commands.
|
|
747
|
+
output_directory : Optional[str]
|
|
748
|
+
Output Directory.
|
|
749
|
+
activate : Optional[bool]
|
|
750
|
+
Automatically activate the deployment when it is finished building.
|
|
751
|
+
on_progress : callable, optional
|
|
752
|
+
Optional callback for upload progress
|
|
753
|
+
|
|
754
|
+
Returns
|
|
755
|
+
-------
|
|
756
|
+
Deployment
|
|
757
|
+
API response as a typed Pydantic model
|
|
758
|
+
|
|
759
|
+
Raises
|
|
760
|
+
------
|
|
761
|
+
AppwriteException
|
|
762
|
+
If API request fails
|
|
763
|
+
"""
|
|
764
|
+
|
|
765
|
+
api_path = '/sites/{siteId}/deployments'
|
|
766
|
+
api_params = {}
|
|
767
|
+
if site_id is None:
|
|
768
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
769
|
+
|
|
770
|
+
if code is None:
|
|
771
|
+
raise AppwriteException('Missing required parameter: "code"')
|
|
772
|
+
|
|
773
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
774
|
+
|
|
775
|
+
if install_command is not None:
|
|
776
|
+
api_params['installCommand'] = self._normalize_value(install_command)
|
|
777
|
+
if build_command is not None:
|
|
778
|
+
api_params['buildCommand'] = self._normalize_value(build_command)
|
|
779
|
+
if output_directory is not None:
|
|
780
|
+
api_params['outputDirectory'] = self._normalize_value(output_directory)
|
|
781
|
+
api_params['code'] = self._normalize_value(code)
|
|
782
|
+
if activate is not None:
|
|
783
|
+
api_params['activate'] = self._normalize_value(str(activate).lower() if type(activate) is bool else activate)
|
|
784
|
+
|
|
785
|
+
param_name = 'code'
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
upload_id = ''
|
|
789
|
+
|
|
790
|
+
response = self.client.chunked_upload(api_path, {
|
|
791
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
792
|
+
'content-type': 'multipart/form-data',
|
|
793
|
+
'accept': 'application/json',
|
|
794
|
+
}, api_params, param_name, on_progress, upload_id)
|
|
795
|
+
|
|
796
|
+
return self._parse_response(response, model=Deployment)
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
def create_duplicate_deployment(
|
|
800
|
+
self,
|
|
801
|
+
site_id: str,
|
|
802
|
+
deployment_id: str
|
|
803
|
+
) -> Deployment:
|
|
804
|
+
"""
|
|
805
|
+
Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
|
|
806
|
+
|
|
807
|
+
Parameters
|
|
808
|
+
----------
|
|
809
|
+
site_id : str
|
|
810
|
+
Site ID.
|
|
811
|
+
deployment_id : str
|
|
812
|
+
Deployment ID.
|
|
813
|
+
|
|
814
|
+
Returns
|
|
815
|
+
-------
|
|
816
|
+
Deployment
|
|
817
|
+
API response as a typed Pydantic model
|
|
818
|
+
|
|
819
|
+
Raises
|
|
820
|
+
------
|
|
821
|
+
AppwriteException
|
|
822
|
+
If API request fails
|
|
823
|
+
"""
|
|
824
|
+
|
|
825
|
+
api_path = '/sites/{siteId}/deployments/duplicate'
|
|
826
|
+
api_params = {}
|
|
827
|
+
if site_id is None:
|
|
828
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
829
|
+
|
|
830
|
+
if deployment_id is None:
|
|
831
|
+
raise AppwriteException('Missing required parameter: "deployment_id"')
|
|
832
|
+
|
|
833
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
834
|
+
|
|
835
|
+
api_params['deploymentId'] = self._normalize_value(deployment_id)
|
|
836
|
+
|
|
837
|
+
response = self.client.call('post', api_path, {
|
|
838
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
839
|
+
'content-type': 'application/json',
|
|
840
|
+
'accept': 'application/json',
|
|
841
|
+
}, api_params)
|
|
842
|
+
|
|
843
|
+
return self._parse_response(response, model=Deployment)
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
def create_template_deployment(
|
|
847
|
+
self,
|
|
848
|
+
site_id: str,
|
|
849
|
+
repository: str,
|
|
850
|
+
owner: str,
|
|
851
|
+
root_directory: str,
|
|
852
|
+
type: TemplateReferenceType,
|
|
853
|
+
reference: str,
|
|
854
|
+
activate: Optional[bool] = None
|
|
855
|
+
) -> Deployment:
|
|
856
|
+
"""
|
|
857
|
+
Create a deployment based on a template.
|
|
858
|
+
|
|
859
|
+
Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/sites/templates) to find the template details.
|
|
860
|
+
|
|
861
|
+
Parameters
|
|
862
|
+
----------
|
|
863
|
+
site_id : str
|
|
864
|
+
Site ID.
|
|
865
|
+
repository : str
|
|
866
|
+
Repository name of the template.
|
|
867
|
+
owner : str
|
|
868
|
+
The name of the owner of the template.
|
|
869
|
+
root_directory : str
|
|
870
|
+
Path to site code in the template repo.
|
|
871
|
+
type : TemplateReferenceType
|
|
872
|
+
Type for the reference provided. Can be commit, branch, or tag
|
|
873
|
+
reference : str
|
|
874
|
+
Reference value, can be a commit hash, branch name, or release tag
|
|
875
|
+
activate : Optional[bool]
|
|
876
|
+
Automatically activate the deployment when it is finished building.
|
|
877
|
+
|
|
878
|
+
Returns
|
|
879
|
+
-------
|
|
880
|
+
Deployment
|
|
881
|
+
API response as a typed Pydantic model
|
|
882
|
+
|
|
883
|
+
Raises
|
|
884
|
+
------
|
|
885
|
+
AppwriteException
|
|
886
|
+
If API request fails
|
|
887
|
+
"""
|
|
888
|
+
|
|
889
|
+
api_path = '/sites/{siteId}/deployments/template'
|
|
890
|
+
api_params = {}
|
|
891
|
+
if site_id is None:
|
|
892
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
893
|
+
|
|
894
|
+
if repository is None:
|
|
895
|
+
raise AppwriteException('Missing required parameter: "repository"')
|
|
896
|
+
|
|
897
|
+
if owner is None:
|
|
898
|
+
raise AppwriteException('Missing required parameter: "owner"')
|
|
899
|
+
|
|
900
|
+
if root_directory is None:
|
|
901
|
+
raise AppwriteException('Missing required parameter: "root_directory"')
|
|
902
|
+
|
|
903
|
+
if type is None:
|
|
904
|
+
raise AppwriteException('Missing required parameter: "type"')
|
|
905
|
+
|
|
906
|
+
if reference is None:
|
|
907
|
+
raise AppwriteException('Missing required parameter: "reference"')
|
|
908
|
+
|
|
909
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
910
|
+
|
|
911
|
+
api_params['repository'] = self._normalize_value(repository)
|
|
912
|
+
api_params['owner'] = self._normalize_value(owner)
|
|
913
|
+
api_params['rootDirectory'] = self._normalize_value(root_directory)
|
|
914
|
+
api_params['type'] = self._normalize_value(type)
|
|
915
|
+
api_params['reference'] = self._normalize_value(reference)
|
|
916
|
+
if activate is not None:
|
|
917
|
+
api_params['activate'] = self._normalize_value(activate)
|
|
918
|
+
|
|
919
|
+
response = self.client.call('post', api_path, {
|
|
920
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
921
|
+
'content-type': 'application/json',
|
|
922
|
+
'accept': 'application/json',
|
|
923
|
+
}, api_params)
|
|
924
|
+
|
|
925
|
+
return self._parse_response(response, model=Deployment)
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
def create_vcs_deployment(
|
|
929
|
+
self,
|
|
930
|
+
site_id: str,
|
|
931
|
+
type: VCSReferenceType,
|
|
932
|
+
reference: str,
|
|
933
|
+
activate: Optional[bool] = None
|
|
934
|
+
) -> Deployment:
|
|
935
|
+
"""
|
|
936
|
+
Create a deployment when a site is connected to VCS.
|
|
937
|
+
|
|
938
|
+
This endpoint lets you create deployment from a branch, commit, or a tag.
|
|
939
|
+
|
|
940
|
+
Parameters
|
|
941
|
+
----------
|
|
942
|
+
site_id : str
|
|
943
|
+
Site ID.
|
|
944
|
+
type : VCSReferenceType
|
|
945
|
+
Type of reference passed. Allowed values are: branch, commit
|
|
946
|
+
reference : str
|
|
947
|
+
VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
|
|
948
|
+
activate : Optional[bool]
|
|
949
|
+
Automatically activate the deployment when it is finished building.
|
|
950
|
+
|
|
951
|
+
Returns
|
|
952
|
+
-------
|
|
953
|
+
Deployment
|
|
954
|
+
API response as a typed Pydantic model
|
|
955
|
+
|
|
956
|
+
Raises
|
|
957
|
+
------
|
|
958
|
+
AppwriteException
|
|
959
|
+
If API request fails
|
|
960
|
+
"""
|
|
961
|
+
|
|
962
|
+
api_path = '/sites/{siteId}/deployments/vcs'
|
|
963
|
+
api_params = {}
|
|
964
|
+
if site_id is None:
|
|
965
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
966
|
+
|
|
967
|
+
if type is None:
|
|
968
|
+
raise AppwriteException('Missing required parameter: "type"')
|
|
969
|
+
|
|
970
|
+
if reference is None:
|
|
971
|
+
raise AppwriteException('Missing required parameter: "reference"')
|
|
972
|
+
|
|
973
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
974
|
+
|
|
975
|
+
api_params['type'] = self._normalize_value(type)
|
|
976
|
+
api_params['reference'] = self._normalize_value(reference)
|
|
977
|
+
if activate is not None:
|
|
978
|
+
api_params['activate'] = self._normalize_value(activate)
|
|
979
|
+
|
|
980
|
+
response = self.client.call('post', api_path, {
|
|
981
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
982
|
+
'content-type': 'application/json',
|
|
983
|
+
'accept': 'application/json',
|
|
984
|
+
}, api_params)
|
|
985
|
+
|
|
986
|
+
return self._parse_response(response, model=Deployment)
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
def get_deployment(
|
|
990
|
+
self,
|
|
991
|
+
site_id: str,
|
|
992
|
+
deployment_id: str
|
|
993
|
+
) -> Deployment:
|
|
994
|
+
"""
|
|
995
|
+
Get a site deployment by its unique ID.
|
|
996
|
+
|
|
997
|
+
Parameters
|
|
998
|
+
----------
|
|
999
|
+
site_id : str
|
|
1000
|
+
Site ID.
|
|
1001
|
+
deployment_id : str
|
|
1002
|
+
Deployment ID.
|
|
1003
|
+
|
|
1004
|
+
Returns
|
|
1005
|
+
-------
|
|
1006
|
+
Deployment
|
|
1007
|
+
API response as a typed Pydantic model
|
|
1008
|
+
|
|
1009
|
+
Raises
|
|
1010
|
+
------
|
|
1011
|
+
AppwriteException
|
|
1012
|
+
If API request fails
|
|
1013
|
+
"""
|
|
1014
|
+
|
|
1015
|
+
api_path = '/sites/{siteId}/deployments/{deploymentId}'
|
|
1016
|
+
api_params = {}
|
|
1017
|
+
if site_id is None:
|
|
1018
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1019
|
+
|
|
1020
|
+
if deployment_id is None:
|
|
1021
|
+
raise AppwriteException('Missing required parameter: "deployment_id"')
|
|
1022
|
+
|
|
1023
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1024
|
+
api_path = api_path.replace('{deploymentId}', str(self._normalize_value(deployment_id)))
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
response = self.client.call('get', api_path, {
|
|
1028
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1029
|
+
'accept': 'application/json',
|
|
1030
|
+
}, api_params)
|
|
1031
|
+
|
|
1032
|
+
return self._parse_response(response, model=Deployment)
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
def delete_deployment(
|
|
1036
|
+
self,
|
|
1037
|
+
site_id: str,
|
|
1038
|
+
deployment_id: str
|
|
1039
|
+
) -> Dict[str, Any]:
|
|
1040
|
+
"""
|
|
1041
|
+
Delete a site deployment by its unique ID.
|
|
1042
|
+
|
|
1043
|
+
Parameters
|
|
1044
|
+
----------
|
|
1045
|
+
site_id : str
|
|
1046
|
+
Site ID.
|
|
1047
|
+
deployment_id : str
|
|
1048
|
+
Deployment ID.
|
|
1049
|
+
|
|
1050
|
+
Returns
|
|
1051
|
+
-------
|
|
1052
|
+
Dict[str, Any]
|
|
1053
|
+
API response as a dictionary
|
|
1054
|
+
|
|
1055
|
+
Raises
|
|
1056
|
+
------
|
|
1057
|
+
AppwriteException
|
|
1058
|
+
If API request fails
|
|
1059
|
+
"""
|
|
1060
|
+
|
|
1061
|
+
api_path = '/sites/{siteId}/deployments/{deploymentId}'
|
|
1062
|
+
api_params = {}
|
|
1063
|
+
if site_id is None:
|
|
1064
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1065
|
+
|
|
1066
|
+
if deployment_id is None:
|
|
1067
|
+
raise AppwriteException('Missing required parameter: "deployment_id"')
|
|
1068
|
+
|
|
1069
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1070
|
+
api_path = api_path.replace('{deploymentId}', str(self._normalize_value(deployment_id)))
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
response = self.client.call('delete', api_path, {
|
|
1074
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1075
|
+
'content-type': 'application/json',
|
|
1076
|
+
}, api_params)
|
|
1077
|
+
|
|
1078
|
+
return response
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
def get_deployment_download(
|
|
1082
|
+
self,
|
|
1083
|
+
site_id: str,
|
|
1084
|
+
deployment_id: str,
|
|
1085
|
+
type: Optional[DeploymentDownloadType] = None,
|
|
1086
|
+
token: Optional[str] = None
|
|
1087
|
+
) -> bytes:
|
|
1088
|
+
"""
|
|
1089
|
+
Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
|
|
1090
|
+
|
|
1091
|
+
Parameters
|
|
1092
|
+
----------
|
|
1093
|
+
site_id : str
|
|
1094
|
+
Site ID.
|
|
1095
|
+
deployment_id : str
|
|
1096
|
+
Deployment ID.
|
|
1097
|
+
type : Optional[DeploymentDownloadType]
|
|
1098
|
+
Deployment file to download. Can be: "source", "output".
|
|
1099
|
+
token : Optional[str]
|
|
1100
|
+
Presigned source-download token for accessing this deployment without a session (jobs-service).
|
|
1101
|
+
|
|
1102
|
+
Returns
|
|
1103
|
+
-------
|
|
1104
|
+
bytes
|
|
1105
|
+
Response as bytes
|
|
1106
|
+
|
|
1107
|
+
Raises
|
|
1108
|
+
------
|
|
1109
|
+
AppwriteException
|
|
1110
|
+
If API request fails
|
|
1111
|
+
"""
|
|
1112
|
+
|
|
1113
|
+
api_path = '/sites/{siteId}/deployments/{deploymentId}/download'
|
|
1114
|
+
api_params = {}
|
|
1115
|
+
if site_id is None:
|
|
1116
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1117
|
+
|
|
1118
|
+
if deployment_id is None:
|
|
1119
|
+
raise AppwriteException('Missing required parameter: "deployment_id"')
|
|
1120
|
+
|
|
1121
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1122
|
+
api_path = api_path.replace('{deploymentId}', str(self._normalize_value(deployment_id)))
|
|
1123
|
+
|
|
1124
|
+
if type is not None:
|
|
1125
|
+
api_params['type'] = self._normalize_value(type)
|
|
1126
|
+
if token is not None:
|
|
1127
|
+
api_params['token'] = self._normalize_value(token)
|
|
1128
|
+
|
|
1129
|
+
response = self.client.call('get', api_path, {
|
|
1130
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1131
|
+
'accept': '*/*',
|
|
1132
|
+
}, api_params)
|
|
1133
|
+
|
|
1134
|
+
return response
|
|
1135
|
+
|
|
1136
|
+
|
|
1137
|
+
def update_deployment_status(
|
|
1138
|
+
self,
|
|
1139
|
+
site_id: str,
|
|
1140
|
+
deployment_id: str
|
|
1141
|
+
) -> Deployment:
|
|
1142
|
+
"""
|
|
1143
|
+
Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
|
|
1144
|
+
|
|
1145
|
+
Parameters
|
|
1146
|
+
----------
|
|
1147
|
+
site_id : str
|
|
1148
|
+
Site ID.
|
|
1149
|
+
deployment_id : str
|
|
1150
|
+
Deployment ID.
|
|
1151
|
+
|
|
1152
|
+
Returns
|
|
1153
|
+
-------
|
|
1154
|
+
Deployment
|
|
1155
|
+
API response as a typed Pydantic model
|
|
1156
|
+
|
|
1157
|
+
Raises
|
|
1158
|
+
------
|
|
1159
|
+
AppwriteException
|
|
1160
|
+
If API request fails
|
|
1161
|
+
"""
|
|
1162
|
+
|
|
1163
|
+
api_path = '/sites/{siteId}/deployments/{deploymentId}/status'
|
|
1164
|
+
api_params = {}
|
|
1165
|
+
if site_id is None:
|
|
1166
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1167
|
+
|
|
1168
|
+
if deployment_id is None:
|
|
1169
|
+
raise AppwriteException('Missing required parameter: "deployment_id"')
|
|
1170
|
+
|
|
1171
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1172
|
+
api_path = api_path.replace('{deploymentId}', str(self._normalize_value(deployment_id)))
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
response = self.client.call('patch', api_path, {
|
|
1176
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1177
|
+
'content-type': 'application/json',
|
|
1178
|
+
'accept': 'application/json',
|
|
1179
|
+
}, api_params)
|
|
1180
|
+
|
|
1181
|
+
return self._parse_response(response, model=Deployment)
|
|
1182
|
+
|
|
1183
|
+
|
|
1184
|
+
def list_logs(
|
|
1185
|
+
self,
|
|
1186
|
+
site_id: str,
|
|
1187
|
+
queries: Optional[List[str]] = None,
|
|
1188
|
+
total: Optional[bool] = None
|
|
1189
|
+
) -> ExecutionList:
|
|
1190
|
+
"""
|
|
1191
|
+
Get a list of all site logs. You can use the query params to filter your results.
|
|
1192
|
+
|
|
1193
|
+
Parameters
|
|
1194
|
+
----------
|
|
1195
|
+
site_id : str
|
|
1196
|
+
Site ID.
|
|
1197
|
+
queries : Optional[List[str]]
|
|
1198
|
+
Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
|
|
1199
|
+
total : Optional[bool]
|
|
1200
|
+
When set to false, the total count returned will be 0 and will not be calculated.
|
|
1201
|
+
|
|
1202
|
+
Returns
|
|
1203
|
+
-------
|
|
1204
|
+
ExecutionList
|
|
1205
|
+
API response as a typed Pydantic model
|
|
1206
|
+
|
|
1207
|
+
Raises
|
|
1208
|
+
------
|
|
1209
|
+
AppwriteException
|
|
1210
|
+
If API request fails
|
|
1211
|
+
"""
|
|
1212
|
+
|
|
1213
|
+
api_path = '/sites/{siteId}/logs'
|
|
1214
|
+
api_params = {}
|
|
1215
|
+
if site_id is None:
|
|
1216
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1217
|
+
|
|
1218
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1219
|
+
|
|
1220
|
+
if queries is not None:
|
|
1221
|
+
api_params['queries'] = self._normalize_value(queries)
|
|
1222
|
+
if total is not None:
|
|
1223
|
+
api_params['total'] = self._normalize_value(total)
|
|
1224
|
+
|
|
1225
|
+
response = self.client.call('get', api_path, {
|
|
1226
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1227
|
+
'accept': 'application/json',
|
|
1228
|
+
}, api_params)
|
|
1229
|
+
|
|
1230
|
+
return self._parse_response(response, model=ExecutionList)
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
def get_log(
|
|
1234
|
+
self,
|
|
1235
|
+
site_id: str,
|
|
1236
|
+
log_id: str
|
|
1237
|
+
) -> Execution:
|
|
1238
|
+
"""
|
|
1239
|
+
Get a site request log by its unique ID.
|
|
1240
|
+
|
|
1241
|
+
Parameters
|
|
1242
|
+
----------
|
|
1243
|
+
site_id : str
|
|
1244
|
+
Site ID.
|
|
1245
|
+
log_id : str
|
|
1246
|
+
Log ID.
|
|
1247
|
+
|
|
1248
|
+
Returns
|
|
1249
|
+
-------
|
|
1250
|
+
Execution
|
|
1251
|
+
API response as a typed Pydantic model
|
|
1252
|
+
|
|
1253
|
+
Raises
|
|
1254
|
+
------
|
|
1255
|
+
AppwriteException
|
|
1256
|
+
If API request fails
|
|
1257
|
+
"""
|
|
1258
|
+
|
|
1259
|
+
api_path = '/sites/{siteId}/logs/{logId}'
|
|
1260
|
+
api_params = {}
|
|
1261
|
+
if site_id is None:
|
|
1262
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1263
|
+
|
|
1264
|
+
if log_id is None:
|
|
1265
|
+
raise AppwriteException('Missing required parameter: "log_id"')
|
|
1266
|
+
|
|
1267
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1268
|
+
api_path = api_path.replace('{logId}', str(self._normalize_value(log_id)))
|
|
1269
|
+
|
|
1270
|
+
|
|
1271
|
+
response = self.client.call('get', api_path, {
|
|
1272
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1273
|
+
'accept': 'application/json',
|
|
1274
|
+
}, api_params)
|
|
1275
|
+
|
|
1276
|
+
return self._parse_response(response, model=Execution)
|
|
1277
|
+
|
|
1278
|
+
|
|
1279
|
+
def delete_log(
|
|
1280
|
+
self,
|
|
1281
|
+
site_id: str,
|
|
1282
|
+
log_id: str
|
|
1283
|
+
) -> Dict[str, Any]:
|
|
1284
|
+
"""
|
|
1285
|
+
Delete a site log by its unique ID.
|
|
1286
|
+
|
|
1287
|
+
Parameters
|
|
1288
|
+
----------
|
|
1289
|
+
site_id : str
|
|
1290
|
+
Site ID.
|
|
1291
|
+
log_id : str
|
|
1292
|
+
Log ID.
|
|
1293
|
+
|
|
1294
|
+
Returns
|
|
1295
|
+
-------
|
|
1296
|
+
Dict[str, Any]
|
|
1297
|
+
API response as a dictionary
|
|
1298
|
+
|
|
1299
|
+
Raises
|
|
1300
|
+
------
|
|
1301
|
+
AppwriteException
|
|
1302
|
+
If API request fails
|
|
1303
|
+
"""
|
|
1304
|
+
|
|
1305
|
+
api_path = '/sites/{siteId}/logs/{logId}'
|
|
1306
|
+
api_params = {}
|
|
1307
|
+
if site_id is None:
|
|
1308
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1309
|
+
|
|
1310
|
+
if log_id is None:
|
|
1311
|
+
raise AppwriteException('Missing required parameter: "log_id"')
|
|
1312
|
+
|
|
1313
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1314
|
+
api_path = api_path.replace('{logId}', str(self._normalize_value(log_id)))
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
response = self.client.call('delete', api_path, {
|
|
1318
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1319
|
+
'content-type': 'application/json',
|
|
1320
|
+
'accept': 'application/json',
|
|
1321
|
+
}, api_params)
|
|
1322
|
+
|
|
1323
|
+
return response
|
|
1324
|
+
|
|
1325
|
+
|
|
1326
|
+
def list_variables(
|
|
1327
|
+
self,
|
|
1328
|
+
site_id: str,
|
|
1329
|
+
queries: Optional[List[str]] = None,
|
|
1330
|
+
total: Optional[bool] = None
|
|
1331
|
+
) -> VariableList:
|
|
1332
|
+
"""
|
|
1333
|
+
Get a list of all variables of a specific site.
|
|
1334
|
+
|
|
1335
|
+
Parameters
|
|
1336
|
+
----------
|
|
1337
|
+
site_id : str
|
|
1338
|
+
Site unique ID.
|
|
1339
|
+
queries : Optional[List[str]]
|
|
1340
|
+
Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, resourceType, resourceId, secret
|
|
1341
|
+
total : Optional[bool]
|
|
1342
|
+
When set to false, the total count returned will be 0 and will not be calculated.
|
|
1343
|
+
|
|
1344
|
+
Returns
|
|
1345
|
+
-------
|
|
1346
|
+
VariableList
|
|
1347
|
+
API response as a typed Pydantic model
|
|
1348
|
+
|
|
1349
|
+
Raises
|
|
1350
|
+
------
|
|
1351
|
+
AppwriteException
|
|
1352
|
+
If API request fails
|
|
1353
|
+
"""
|
|
1354
|
+
|
|
1355
|
+
api_path = '/sites/{siteId}/variables'
|
|
1356
|
+
api_params = {}
|
|
1357
|
+
if site_id is None:
|
|
1358
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1359
|
+
|
|
1360
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1361
|
+
|
|
1362
|
+
if queries is not None:
|
|
1363
|
+
api_params['queries'] = self._normalize_value(queries)
|
|
1364
|
+
if total is not None:
|
|
1365
|
+
api_params['total'] = self._normalize_value(total)
|
|
1366
|
+
|
|
1367
|
+
response = self.client.call('get', api_path, {
|
|
1368
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1369
|
+
'accept': 'application/json',
|
|
1370
|
+
}, api_params)
|
|
1371
|
+
|
|
1372
|
+
return self._parse_response(response, model=VariableList)
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
def create_variable(
|
|
1376
|
+
self,
|
|
1377
|
+
site_id: str,
|
|
1378
|
+
variable_id: str,
|
|
1379
|
+
key: str,
|
|
1380
|
+
value: str,
|
|
1381
|
+
secret: Optional[bool] = None
|
|
1382
|
+
) -> Variable:
|
|
1383
|
+
"""
|
|
1384
|
+
Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.
|
|
1385
|
+
|
|
1386
|
+
Parameters
|
|
1387
|
+
----------
|
|
1388
|
+
site_id : str
|
|
1389
|
+
Site unique ID.
|
|
1390
|
+
variable_id : str
|
|
1391
|
+
Variable ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
1392
|
+
key : str
|
|
1393
|
+
Variable key. Max length: 255 chars.
|
|
1394
|
+
value : str
|
|
1395
|
+
Variable value. Max length: 8192 chars.
|
|
1396
|
+
secret : Optional[bool]
|
|
1397
|
+
Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
|
1398
|
+
|
|
1399
|
+
Returns
|
|
1400
|
+
-------
|
|
1401
|
+
Variable
|
|
1402
|
+
API response as a typed Pydantic model
|
|
1403
|
+
|
|
1404
|
+
Raises
|
|
1405
|
+
------
|
|
1406
|
+
AppwriteException
|
|
1407
|
+
If API request fails
|
|
1408
|
+
"""
|
|
1409
|
+
|
|
1410
|
+
api_path = '/sites/{siteId}/variables'
|
|
1411
|
+
api_params = {}
|
|
1412
|
+
if site_id is None:
|
|
1413
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1414
|
+
|
|
1415
|
+
if variable_id is None:
|
|
1416
|
+
raise AppwriteException('Missing required parameter: "variable_id"')
|
|
1417
|
+
|
|
1418
|
+
if key is None:
|
|
1419
|
+
raise AppwriteException('Missing required parameter: "key"')
|
|
1420
|
+
|
|
1421
|
+
if value is None:
|
|
1422
|
+
raise AppwriteException('Missing required parameter: "value"')
|
|
1423
|
+
|
|
1424
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1425
|
+
|
|
1426
|
+
api_params['variableId'] = self._normalize_value(variable_id)
|
|
1427
|
+
api_params['key'] = self._normalize_value(key)
|
|
1428
|
+
api_params['value'] = self._normalize_value(value)
|
|
1429
|
+
if secret is not None:
|
|
1430
|
+
api_params['secret'] = self._normalize_value(secret)
|
|
1431
|
+
|
|
1432
|
+
response = self.client.call('post', api_path, {
|
|
1433
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1434
|
+
'content-type': 'application/json',
|
|
1435
|
+
'accept': 'application/json',
|
|
1436
|
+
}, api_params)
|
|
1437
|
+
|
|
1438
|
+
return self._parse_response(response, model=Variable)
|
|
1439
|
+
|
|
1440
|
+
|
|
1441
|
+
def get_variable(
|
|
1442
|
+
self,
|
|
1443
|
+
site_id: str,
|
|
1444
|
+
variable_id: str
|
|
1445
|
+
) -> Variable:
|
|
1446
|
+
"""
|
|
1447
|
+
Get a variable by its unique ID.
|
|
1448
|
+
|
|
1449
|
+
Parameters
|
|
1450
|
+
----------
|
|
1451
|
+
site_id : str
|
|
1452
|
+
Site unique ID.
|
|
1453
|
+
variable_id : str
|
|
1454
|
+
Variable unique ID.
|
|
1455
|
+
|
|
1456
|
+
Returns
|
|
1457
|
+
-------
|
|
1458
|
+
Variable
|
|
1459
|
+
API response as a typed Pydantic model
|
|
1460
|
+
|
|
1461
|
+
Raises
|
|
1462
|
+
------
|
|
1463
|
+
AppwriteException
|
|
1464
|
+
If API request fails
|
|
1465
|
+
"""
|
|
1466
|
+
|
|
1467
|
+
api_path = '/sites/{siteId}/variables/{variableId}'
|
|
1468
|
+
api_params = {}
|
|
1469
|
+
if site_id is None:
|
|
1470
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1471
|
+
|
|
1472
|
+
if variable_id is None:
|
|
1473
|
+
raise AppwriteException('Missing required parameter: "variable_id"')
|
|
1474
|
+
|
|
1475
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1476
|
+
api_path = api_path.replace('{variableId}', str(self._normalize_value(variable_id)))
|
|
1477
|
+
|
|
1478
|
+
|
|
1479
|
+
response = self.client.call('get', api_path, {
|
|
1480
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1481
|
+
'accept': 'application/json',
|
|
1482
|
+
}, api_params)
|
|
1483
|
+
|
|
1484
|
+
return self._parse_response(response, model=Variable)
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
def update_variable(
|
|
1488
|
+
self,
|
|
1489
|
+
site_id: str,
|
|
1490
|
+
variable_id: str,
|
|
1491
|
+
key: Optional[str] = None,
|
|
1492
|
+
value: Optional[str] = None,
|
|
1493
|
+
secret: Optional[bool] = None
|
|
1494
|
+
) -> Variable:
|
|
1495
|
+
"""
|
|
1496
|
+
Update variable by its unique ID.
|
|
1497
|
+
|
|
1498
|
+
Parameters
|
|
1499
|
+
----------
|
|
1500
|
+
site_id : str
|
|
1501
|
+
Site unique ID.
|
|
1502
|
+
variable_id : str
|
|
1503
|
+
Variable unique ID.
|
|
1504
|
+
key : Optional[str]
|
|
1505
|
+
Variable key. Max length: 255 chars.
|
|
1506
|
+
value : Optional[str]
|
|
1507
|
+
Variable value. Max length: 8192 chars.
|
|
1508
|
+
secret : Optional[bool]
|
|
1509
|
+
Secret variables can be updated or deleted, but only sites can read them during build and runtime.
|
|
1510
|
+
|
|
1511
|
+
Returns
|
|
1512
|
+
-------
|
|
1513
|
+
Variable
|
|
1514
|
+
API response as a typed Pydantic model
|
|
1515
|
+
|
|
1516
|
+
Raises
|
|
1517
|
+
------
|
|
1518
|
+
AppwriteException
|
|
1519
|
+
If API request fails
|
|
1520
|
+
"""
|
|
1521
|
+
|
|
1522
|
+
api_path = '/sites/{siteId}/variables/{variableId}'
|
|
1523
|
+
api_params = {}
|
|
1524
|
+
if site_id is None:
|
|
1525
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1526
|
+
|
|
1527
|
+
if variable_id is None:
|
|
1528
|
+
raise AppwriteException('Missing required parameter: "variable_id"')
|
|
1529
|
+
|
|
1530
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1531
|
+
api_path = api_path.replace('{variableId}', str(self._normalize_value(variable_id)))
|
|
1532
|
+
|
|
1533
|
+
if key is not None:
|
|
1534
|
+
api_params['key'] = self._normalize_value(key)
|
|
1535
|
+
if value is not None:
|
|
1536
|
+
api_params['value'] = self._normalize_value(value)
|
|
1537
|
+
if secret is not None:
|
|
1538
|
+
api_params['secret'] = self._normalize_value(secret)
|
|
1539
|
+
|
|
1540
|
+
response = self.client.call('put', api_path, {
|
|
1541
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1542
|
+
'content-type': 'application/json',
|
|
1543
|
+
'accept': 'application/json',
|
|
1544
|
+
}, api_params)
|
|
1545
|
+
|
|
1546
|
+
return self._parse_response(response, model=Variable)
|
|
1547
|
+
|
|
1548
|
+
|
|
1549
|
+
def delete_variable(
|
|
1550
|
+
self,
|
|
1551
|
+
site_id: str,
|
|
1552
|
+
variable_id: str
|
|
1553
|
+
) -> Dict[str, Any]:
|
|
1554
|
+
"""
|
|
1555
|
+
Delete a variable by its unique ID.
|
|
1556
|
+
|
|
1557
|
+
Parameters
|
|
1558
|
+
----------
|
|
1559
|
+
site_id : str
|
|
1560
|
+
Site unique ID.
|
|
1561
|
+
variable_id : str
|
|
1562
|
+
Variable unique ID.
|
|
1563
|
+
|
|
1564
|
+
Returns
|
|
1565
|
+
-------
|
|
1566
|
+
Dict[str, Any]
|
|
1567
|
+
API response as a dictionary
|
|
1568
|
+
|
|
1569
|
+
Raises
|
|
1570
|
+
------
|
|
1571
|
+
AppwriteException
|
|
1572
|
+
If API request fails
|
|
1573
|
+
"""
|
|
1574
|
+
|
|
1575
|
+
api_path = '/sites/{siteId}/variables/{variableId}'
|
|
1576
|
+
api_params = {}
|
|
1577
|
+
if site_id is None:
|
|
1578
|
+
raise AppwriteException('Missing required parameter: "site_id"')
|
|
1579
|
+
|
|
1580
|
+
if variable_id is None:
|
|
1581
|
+
raise AppwriteException('Missing required parameter: "variable_id"')
|
|
1582
|
+
|
|
1583
|
+
api_path = api_path.replace('{siteId}', str(self._normalize_value(site_id)))
|
|
1584
|
+
api_path = api_path.replace('{variableId}', str(self._normalize_value(variable_id)))
|
|
1585
|
+
|
|
1586
|
+
|
|
1587
|
+
response = self.client.call('delete', api_path, {
|
|
1588
|
+
'X-Appwrite-Project': self.client.get_config('project'),
|
|
1589
|
+
'content-type': 'application/json',
|
|
1590
|
+
}, api_params)
|
|
1591
|
+
|
|
1592
|
+
return response
|
|
1593
|
+
|