Lettura da entità Twilio
Prerequisito
Un oggetto di Twilio da cui si desidera leggere. È necessario il nome dell'oggetto, come SMS-Message o SMS-CountryPricing.
Entità supportate come origine:
| Entità | Interfaccia | Può essere filtrato | Supporta limite | Supporta Ordina per | Supporta Seleziona * | Supporta il partizionamento |
|---|---|---|---|---|---|---|
| SMS-Message | REST | Sì | Sì | No | Sì | Sì |
| SMS-CountryPricing | REST | No | No | No | Sì | No |
| Voice-Call | REST | Sì | Sì | No | Sì | No |
| Voice-Application | REST | Sì | Sì | No | Sì | No |
| Voice-OutgoingCallerID | REST | Sì | Sì | No | Sì | No |
| Voice-Queue | REST | Sì | Sì | No | Sì | No |
| Conversations-Conversation | REST | Sì | Sì | No | Sì | No |
| Conversations-User | REST | No | Sì | No | Sì | No |
| Conversations-Role | REST | No | Sì | No | Sì | No |
| Conversations-Configuration | REST | No | No | No | Sì | No |
| Conversations-AddressConfiguration | REST | Sì | Sì | No | Sì | No |
| Conversations-WebhookConfiguration | REST | No | No | No | Sì | No |
| Conversations-ParticipantConversation | REST | No | No | No | Sì | No |
| Conversations-Credential | REST | No | Sì | No | Sì | No |
| Conversations-ConversationService | REST | No | Sì | No | Sì | No |
Esempio:
twilio_read = glueContext.create_dynamic_frame.from_options( connection_type="twilio", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "sms-message", "API_VERSION": "2010-04-01", "Edge_Location": "sydney.us1" }
Dettagli dell'entità e del campo di Twilio
| Entità | Campo | Tipo di dati | Operatori supportati |
|---|---|---|---|
| SMS-Message | account_sid | Stringa | N/A |
| api_version | Stringa | N/A | |
| body | Stringa | N/A | |
| date_created | Datetime | N/D | |
| date_sent | Datetime | >=, <=, = | |
| date_updated | Datetime | N/D | |
| direction | Stringa | N/A | |
| error_code | Numero intero | N/D | |
| error_message | Stringa | N/A | |
| from | Numero intero | = | |
| messaging_service_sid | Stringa | N/A | |
| num_media | Stringa | N/A | |
| num_segments | Stringa | N/A | |
| price | Stringa | N/A | |
| price_unit | Struct | N/D | |
| sid | Numero intero | N/D | |
| status | Stringa | N/A | |
| subresource_uris | Eseguire la mappatura | N/D | |
| in | Numero intero | = | |
| uri | Datetime | N/D | |
| SMS-CountryPricing | country | Stringa | N/A |
| iso_country | Stringa | N/A | |
| url | Stringa | N/A | |
| outbound_sms_prices | Elenco | N/D | |
| inbound_sms_prices | Elenco | N/D | |
| price_unit | Stringa | N/A | |
| Voice-Call | account_sid | Stringa | N/A |
| annotazione | Stringa | N/A | |
| answered_by | Stringa | N/A | |
| api_version | Stringa | N/A | |
| caller_name | Stringa | N/A | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| direction | Stringa | N/A | |
| durata | Stringa | N/A | |
| end_time | Datetime | >=, <=, = | |
| forwarded_from | Stringa | N/A | |
| from | Stringa | = | |
| from_formatted | Stringa | N/A | |
| group_sid | Stringa | N/A | |
| parent_call_sid | Stringa | N/A | |
| phone_number_sid | Stringa | N/A | |
| price | Stringa | N/A | |
| price_unit | Stringa | N/A | |
| sid | Stringa | N/A | |
| start_time | Datetime | >=, <=, = | |
| status | Stringa | = | |
| subresource_uris | Stringa | N/A | |
| in | Stringa | = | |
| to_formatted | Stringa | N/A | |
| trunk_sid | Stringa | N/A | |
| uri | Stringa | N/A | |
| queue_time | Stringa | N/A | |
| Voice-Application | account_sid | Stringa | N/A |
| api_version | Stringa | N/A | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| friendly_name | Stringa | = | |
| message_status_callback | Stringa | N/A | |
| sid | Stringa | N/A | |
| sms_fallback_method | Stringa | N/A | |
| sms_fallback_url | Stringa | N/A | |
| sms_method | Stringa | N/A | |
| sms_status_callback | Stringa | N/A | |
| sms_url | Stringa | N/A | |
| status_callback | Stringa | N/A | |
| status_callback_method | Stringa | N/A | |
| uri | Stringa | N/A | |
| voice_caller_id_lookup | Booleano | N/D | |
| voice_fallback_method | Stringa | N/A | |
| voice_fallback_url | Stringa | N/A | |
| voice_method | Stringa | N/A | |
| voice_url | Stringa | N/A | |
| public_application_connect_enabled | Booleano | N/D | |
| Voice-OutgoingCallerID | sid | Stringa | N/A |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| account_sid | Stringa | N/A | |
| friendly_name | Stringa | = | |
| phone_number | Stringa | = | |
| uri | Stringa | N/A | |
| Voice-Queue | date_created | Datetime | N/D |
| date_updated | Datetime | N/D | |
| current_size | Numero intero | N/D | |
| friendly_name | Stringa | N/A | |
| uri | Stringa | N/A | |
| account_sid | Stringa | N/A | |
| average_wait_time | Numero intero | N/D | |
| sid | Stringa | N/A | |
| max_size | Numero intero | N/D | |
| Conversations-Conversation | account_sid | Stringa | N/A |
| chat_service_sid | Stringa | N/A | |
| messaging_service_sid | Stringa | N/A | |
| sid | Stringa | N/A | |
| friendly_name | Stringa | N/A | |
| unique_name | Stringa | N/A | |
| attributes | Stringa | N/A | |
| stato | Stringa | = | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| timers | Struct | N/D | |
| url | Stringa | N/A | |
| links | Struct | N/D | |
| bindings | Struct | N/D | |
| start_date | Datetime | = | |
| end_date | Datetime | = | |
| Timers.DateInactive | Stringa | N/A | |
| Timers.DateClosed | Stringa | N/A | |
| Conversations-User | sid | Stringa | N/A |
| account_sid | Stringa | N/A | |
| chat_service_sid | Stringa | N/A | |
| role_sid | Stringa | N/A | |
| identity | Stringa | N/A | |
| friendly_name | Stringa | N/A | |
| attributes | Stringa | N/A | |
| is_online | Booleano | N/D | |
| is_notifiable | Booleano | N/D | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| url | Stringa | N/A | |
| links | Struct | N/D | |
| Conversations-Role | sid | Stringa | N/A |
| account_sid | Stringa | N/A | |
| chat_service_sid | Stringa | N/A | |
| friendly_name | Stringa | N/A | |
| tipo | Stringa | N/A | |
| autorizzazioni | Stringa | N/A | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| url | Stringa | N/A | |
| Conversations-Configuration | account_sid | Long | N/D |
| default_chat_service_sid | Stringa | N/A | |
| default_messaging_service_sid | Stringa | N/A | |
| default_inactive_timer | Stringa | N/A | |
| default_closed_timer | Stringa | N/A | |
| url | Stringa | N/A | |
| links | Eseguire la mappatura | N/D | |
| Conversations-AddressConfiguration | sid | Stringa | N/A |
| account_sid | Stringa | N/A | |
| tipo | Stringa | N/A | |
| address | Stringa | N/A | |
| friendly_name | Stringa | N/A | |
| auto_creation | Struct | N/D | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| url | Stringa | N/A | |
| address_country | Stringa | N/A | |
| AutoCreation.Enabled | Booleano | N/D | |
| AutoCreation.Type | Stringa | N/A | |
| AutoCreation.ConversationServiceSid | Stringa | N/A | |
| AutoCreation.WebhookUrl | Stringa | N/A | |
| AutoCreation.WebhookMethod | Stringa | N/A | |
| AutoCreation.WebhookFilters | Elenco | N/D | |
| AutoCreation.StudioFlowSid | Stringa | N/A | |
| AutoCreation.StudioRetryCount | Numero intero | N/D | |
| Conversations-WebhookConfiguration | account_sid | Stringa | N/A |
| metodo | Stringa | N/A | |
| filtri | Elenco | N/D | |
| pre_webhook_url | Stringa | N/A | |
| post_webhook_url | Stringa | N/A | |
| target | Stringa | N/A | |
| url | Stringa | N/A | |
| Converations-ParticipantConversation | account_sid | Stringa | N/A |
| chat_service_sid | Stringa | N/A | |
| participant_sid | Stringa | N/A | |
| participant_user_sid | Stringa | N/A | |
| participant_identity | Stringa | N/A | |
| participant_messaging_binding | Struct | N/D | |
| Conversation_sid | Stringa | N/A | |
| conversation_unique_name | Stringa | N/A | |
| conversation_friendly_name | Stringa | N/A | |
| conversation_attributes | Stringa | N/A | |
| conversation_date_created | Datetime | N/D | |
| conversation_date_updated | Datetime | N/D | |
| conversation_created_by | Stringa | N/A | |
| conversation_state | Stringa | N/A | |
| conversation_timers | Struct | N/D | |
| links | Eseguire la mappatura | N/D | |
| address | Stringa | = | |
| identity | Stringa | = | |
| Conversation-Credentials | sid | Stringa | N/A |
| account_sid | Stringa | N/A | |
| friendly_name | Stringa | N/A | |
| tipo | Stringa | N/A | |
| sandbox | Stringa | N/A | |
| date_created | Datetime | N/D | |
| dated_updated | Datetime | N/D | |
| url | Stringa | N/A | |
| certificato | Stringa | N/A | |
| private_key | Stringa | N/A | |
| api_key | Stringa | N/A | |
| Secret | Stringa | N/A | |
| Conversations-ConversationService | sid | Stringa | N/A |
| account_sid | Stringa | N/A | |
| friendly_name | Stringa | N/A | |
| date_created | Datetime | N/D | |
| date_updated | Datetime | N/D | |
| url | Stringa | N/A | |
| links | Eseguire la mappatura | N/D |
Query di partizionamento
Campi che supportano il partizionamento:
In Twilio, i campi del tipo di dati DateTime supportano il partizionamento basato sul campo.
È possibile fornire le opzioni Spark aggiuntive PARTITION_FIELD, LOWER_BOUND, UPPER_BOUND e NUM_PARTITIONS se si desidera utilizzare la simultaneità in Spark. Con questi parametri, la query originale viene suddivisa in NUM_PARTITIONS query secondarie che possono essere eseguite contemporaneamente dalle attività Spark.
PARTITION_FIELD: il nome del campo da utilizzare per partizionare la query.LOWER_BOUND: un valore limite inferiore inclusivo del campo di partizione scelto.Per il campo Datetime, accettiamo il formato di timestamp Spark utilizzato nelle query SQL di Spark.
Esempi di valore valido:
"2024-05-01T20:55:02.000Z"UPPER_BOUND: un valore limite superiore esclusivo del campo di partizione scelto.NUM_PARTITIONS: il numero di partizioni.
Esempio:
twilio_read = glueContext.create_dynamic_frame.from_options( connection_type="twilio", connection_options={ "connectionName": "connectionName", "ENTITY_NAME": "sms-message", "API_VERSION": "2010-04-01", "PARTITION_FIELD": "date_sent" "LOWER_BOUND": "2024-05-01T20:55:02.000Z" "UPPER_BOUND": "2024-06-01T20:55:02.000Z" "NUM_PARTITIONS": "10" }