Administración de Applications con la CLI de Vonage

La CLI de Vonage te permite crear y gestionar tus aplicaciones de Vonage. Para obtener ayuda, escribe vonage apps --help una vez que la CLI ha sido instalada. Como la mayoría de los comandos vonage, usted es capaz de utilizar el --json y --yaml para que la salida esté en esos formatos.

Listado de sus Applications

Por defecto, cuando se ejecuta vonage apps ejecutará el mismo subcomando que vonage apps list. Hay una serie de banderas que puede pasar para refinar su búsqueda:

vonage apps

✅ Loading applications... Done

App ID                                Name               Capabilities
------------------------------------  -----------------  ------------------------------------------------------
00000000-0000-0000-0000-000000000000  Application        None
00000000-0000-0000-0000-000000000000  voice Application  Messages, Voice
00000000-0000-0000-0000-000000000000  All enabled        Messages, Network APIs, RTC, VBC, Verify, Video, Voice
vonage apps

✅ Loading applications... Done

App ID                                Name               Capabilities
------------------------------------  -----------------  ------------------------------------------------------
00000000-0000-0000-0000-000000000000  Application        None
00000000-0000-0000-0000-000000000000  voice Application  Messages, Voice
00000000-0000-0000-0000-000000000000  All enabled        Messages, Network APIs, RTC, VBC, Verify, Video, Voice
vonage apps ✅ Loading applications... Done App ID Name Capabilities ------------------------------------ ------------------ ------------------------------------------------------ 00000000-0000-0000-0000-000000000000 Application None 00000000-0000-0000-0000-000000000000 voice Application Messages, Voice 00000000-0000-0000-0000-000000000000 All enabled Messages, Network APIs, RTC, VBC, Verify, Video, Voice

Mostrar detalles de la aplicación

El show subcomando le permite obtener los detalles de una aplicación específica. El formato del comando es vonage apps show <id>donde <id> es el UUID de la aplicación.

Nota: Esto no mostrará la clave pública. Si necesita ver la clave pública, puede utilizar la función --show-all, --json, o --yaml indicadores, que no ocultarán ninguna información.

vonage apps show 00000000-0000-0000-0000-000000000000

✅ Fetching application

Name: All enabled
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  VOICE:
    Uses Signed callbacks: On
    Conversation TTL: 41 hours
    Leg Persistence Time: 6 days
    Event URL: [GET] https://example.com/voice/event
    Answer URL: [GET] https://example.com/voice/answer
    Fallback URL: [GET] https://example.com/voice/fallback
  
  MESSAGES:
    Authenticate Inbound Media: On
    Webhook Version: v1
    Status URL: [POST] https://example.com/meetings/status
    Inbound URL: [POST] https://example.com/meetings/inbound
  
  VERIFY:
    Webhook Version: v2
    Status URL: [POST] https://example.com/verify2/status
  
  RTC:
    Event URL: [POST] https://example.com/rtc/event
    Uses Signed callbacks: On
  
  VIDEO:
    Archive Status URL: [POST] https://example.com/video/archive-status
    Archive Status Signature Secret: archive status
    Broadcast Status URL: [POST] https://example.com/video/broadcast-status
    Broadcast Status Signature Secret: broadcast status
    Caption Status URL: [POST] https://example.com/video/caption-status
    Caption Status Signature Secret: caption-status
    Connection Created URL: [POST] https://example.com/video/connected-created
    Connection Created Signature Secret: connection created
    Connection Destroyed URL: [POST] https://example.com/video/connection-destroyed
    Connection Destroyed Signature Secret: connection destroyed
    Render Status URL: [POST] https://example.com/video/render-status
    Render Status Signature Secret: render status
    SIP Call Created URL: [POST] https://example.com/video/sip1
    SIP Call Created Signature Secret: Off
    SIP Call Destroyed URL: [POST] https://example.com/video/sip3
    SIP Call Destroyed Signature Secret: Off
    SIP Call Mute Forced URL: [POST] https://example.com/video/sip4
    SIP Call Mute Forced Signature Secret: Off
    SIP Call Updated URL: [POST] https://example.com/video/sip2
    SIP Call Updated Signature Secret: Off
    Stream Created URL: [POST] https://example.com/video/stream-created
    Stream Created Signature Secret: stream created
    Stream Destroyed URL: [POST] https://example.com/video/stream-destroyed
    Stream Destroyed Signature Secret: stream destroyed
  
    RECORDINGS STORAGE:
      Cloud Storage: On
      Storage Type: AmazonS3
      Credential: manchuck_aws_bucket
      End to End Encryption: On
      Server Side Encryption: On
  
  NETWORK APIS:
    Redirect URL: [GET] https://example.com/gnp/redirect
  
  NB: VBC capabilities is not supported through the command line.
vonage apps show 00000000-0000-0000-0000-000000000000

✅ Fetching application

Name: All enabled
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  VOICE:
    Uses Signed callbacks: On
    Conversation TTL: 41 hours
    Leg Persistence Time: 6 days
    Event URL: [GET] https://example.com/voice/event
    Answer URL: [GET] https://example.com/voice/answer
    Fallback URL: [GET] https://example.com/voice/fallback
  
  MESSAGES:
    Authenticate Inbound Media: On
    Webhook Version: v1
    Status URL: [POST] https://example.com/meetings/status
    Inbound URL: [POST] https://example.com/meetings/inbound
  
  VERIFY:
    Webhook Version: v2
    Status URL: [POST] https://example.com/verify2/status
  
  RTC:
    Event URL: [POST] https://example.com/rtc/event
    Uses Signed callbacks: On
  
  VIDEO:
    Archive Status URL: [POST] https://example.com/video/archive-status
    Archive Status Signature Secret: archive status
    Broadcast Status URL: [POST] https://example.com/video/broadcast-status
    Broadcast Status Signature Secret: broadcast status
    Caption Status URL: [POST] https://example.com/video/caption-status
    Caption Status Signature Secret: caption-status
    Connection Created URL: [POST] https://example.com/video/connected-created
    Connection Created Signature Secret: connection created
    Connection Destroyed URL: [POST] https://example.com/video/connection-destroyed
    Connection Destroyed Signature Secret: connection destroyed
    Render Status URL: [POST] https://example.com/video/render-status
    Render Status Signature Secret: render status
    SIP Call Created URL: [POST] https://example.com/video/sip1
    SIP Call Created Signature Secret: Off
    SIP Call Destroyed URL: [POST] https://example.com/video/sip3
    SIP Call Destroyed Signature Secret: Off
    SIP Call Mute Forced URL: [POST] https://example.com/video/sip4
    SIP Call Mute Forced Signature Secret: Off
    SIP Call Updated URL: [POST] https://example.com/video/sip2
    SIP Call Updated Signature Secret: Off
    Stream Created URL: [POST] https://example.com/video/stream-created
    Stream Created Signature Secret: stream created
    Stream Destroyed URL: [POST] https://example.com/video/stream-destroyed
    Stream Destroyed Signature Secret: stream destroyed
  
    RECORDINGS STORAGE:
      Cloud Storage: On
      Storage Type: AmazonS3
      Credential: manchuck_aws_bucket
      End to End Encryption: On
      Server Side Encryption: On
  
  NETWORK APIS:
    Redirect URL: [GET] https://example.com/gnp/redirect
  
  NB: VBC capabilities is not supported through the command line.
vonage apps show 00000000-0000-0000-0000-000000000000 ✅ Fetching application Name: All enabled Application ID: 00000000-0000-0000-0000-000000000000 Improve AI: Off Private/Public Key: Set Capabilities: VOICE: Uses Signed callbacks: On Conversation TTL: 41 hours Leg Persistence Time: 6 days Event URL: [GET] https://example.com/voice/event Answer URL: [GET] https://example.com/voice/answer Fallback URL: [GET] https://example.com/voice/fallback MESSAGES: Authenticate Inbound Media: On Webhook Version: v1 Status URL: [POST] https://example.com/meetings/status Inbound URL: [POST] https://example.com/meetings/inbound VERIFY: Webhook Version: v2 Status URL: [POST] https://example.com/verify2/status RTC: Event URL: [POST] https://example.com/rtc/event Uses Signed callbacks: On VIDEO: Archive Status URL: [POST] https://example.com/video/archive-status Archive Status Signature Secret: archive status Broadcast Status URL: [POST] https://example.com/video/broadcast-status Broadcast Status Signature Secret: broadcast status Caption Status URL: [POST] https://example.com/video/caption-status Caption Status Signature Secret: caption-status Connection Created URL: [POST] https://example.com/video/connected-created Connection Created Signature Secret: connection created Connection Destroyed URL: [POST] https://example.com/video/connection-destroyed Connection Destroyed Signature Secret: connection destroyed Render Status URL: [POST] https://example.com/video/render-status Render Status Signature Secret: render status SIP Call Created URL: [POST] https://example.com/video/sip1 SIP Call Created Signature Secret: Off SIP Call Destroyed URL: [POST] https://example.com/video/sip3 SIP Call Destroyed Signature Secret: Off SIP Call Mute Forced URL: [POST] https://example.com/video/sip4 SIP Call Mute Forced Signature Secret: Off SIP Call Updated URL: [POST] https://example.com/video/sip2 SIP Call Updated Signature Secret: Off Stream Created URL: [POST] https://example.com/video/stream-created Stream Created Signature Secret: stream created Stream Destroyed URL: [POST] https://example.com/video/stream-destroyed Stream Destroyed Signature Secret: stream destroyed RECORDINGS STORAGE: Cloud Storage: On Storage Type: AmazonS3 Credential: manchuck_aws_bucket End to End Encryption: On Server Side Encryption: On NETWORK APIS: Redirect URL: [GET] https://example.com/gnp/redirect NB: VBC capabilities is not supported through the command line.

Creación de una aplicación

El vonage apps create <name> permite crear una aplicación. Debe introducir un nombre de aplicación, ya que la CLI no lo generará por usted.

El comando tiene las siguientes banderas:

Nota: si no proporcionas tu propia clave, Vonage creará una para ti. Sin embargo, si no guardas la clave cuando se crea la aplicación, no podrás volver a acceder a ella. Tendrás que volver a generar la clave si la pierdes.

vonage apps create 'Your application'

✅ Creating Application
Saving private key ... Done!
Application created

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  None Enabled
vonage apps create 'Your application'

✅ Creating Application
Saving private key ... Done!
Application created

Name: Your application
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set

Capabilities:
  None Enabled
vonage apps create 'Your application' ✅ Creating Application Saving private key ... Done! Application created Name: Your application Application ID: 00000000-0000-0000-0000-000000000000 Improve AI: Off Private/Public Key: Set Capabilities: None Enabled

Las versiones anteriores de la CLI permitían también configurar las capacidades de las aplicaciones; sin embargo, esta función se ha eliminado en la versión 3 de la CLI; a continuación se explican los motivos. debajo de.

Actualización de una aplicación

vonage apps update <id> te permite actualizar el nombre de una aplicación existente, modificar la configuración de «Mejorar la IA» o establecer una nueva clave pública:

vonage apps update 00000000-0000-0000-0000-000000000000 `
  --name="New Application Name"
  
✅ Fetching Application
✅ Updating Application

Name: New Application Name
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set
vonage apps update 00000000-0000-0000-0000-000000000000 ^
  --name="New Application Name"
  
✅ Fetching Application
✅ Updating Application

Name: New Application Name
Application ID: 00000000-0000-0000-0000-000000000000
Improve AI: Off
Private/Public Key: Set
vonage apps update 00000000-0000-0000-0000-000000000000 \ --name="New Application Name" ✅ Fetching Application ✅ Updating Application Name: New Application Name Application ID: 00000000-0000-0000-0000-000000000000 Improve AI: Off Private/Public Key: Set

Cómo eliminar una aplicación

Puede eliminar una aplicación con el comando vonage apps delete <id>donde id es el UUID de la aplicación:

vonage apps delete 00000000-0000-0000-0000-000000000000

✅ Fetching application
Delete application New Name (7d7133ab-de4e-4b7a-8e1e-376670077c71)? [y/n] 
✅ Deleting application
vonage apps delete 00000000-0000-0000-0000-000000000000

✅ Fetching application
Delete application New Name (7d7133ab-de4e-4b7a-8e1e-376670077c71)? [y/n] 
✅ Deleting application
vonage apps delete 00000000-0000-0000-0000-000000000000 ✅ Fetching application Delete application New Name (7d7133ab-de4e-4b7a-8e1e-376670077c71)? [y/n] ✅ Deleting application

Gestión de las capacidades de una aplicación

En versiones anteriores de la CLI, era necesario introducir todos los valores cuando se quería modificar una capacidad de una aplicación. Esto significaba que había que recordar cuáles eran los valores actuales y, si no se incluía un indicador o se introducía un valor incorrecto, la capacidad no funcionaba como se esperaba. La versión 3 de la CLI resuelve este problema con un nuevo subcomando para gestionar las capacidades de las aplicaciones. El formato del comando es el siguiente: vonage apps capabilities <action> <id> <which> [flags].

Gestión de Numbers para una Applications

La versión 3 de la CLI permite gestionar fácilmente los Numbers de una aplicación. Hay dos comandos principales: vonage apps numbers list <id>, y, vonage apps numbers <link|unlink> <id> <msisdn>. El uso de estos comandos garantizará que los Numbers se vinculen correctamente.

Listado de los Numbers vinculados a una Application

Para ver todos los números vinculados a una aplicación, ejecuta vonage apps numbers list <id>donde id es el UUID de la aplicación. Si pasas el --fail este comando saldrá con el código 1 si la aplicación no tiene ni messages o voice capacidades.

Nota: Esto hará que se llame continuamente a la API para recuperar todos los números que hayas vinculado. Esto puede tardar un rato, dependiendo del número de números que tengas.

vonage apps numbers list 00000000-0000-0000-0000-000000000000

✅ Fetching Application
Fetching numbers linked to application Your application [==============] 1/1 100%

There is 1 number linked:

Number       Country             Type       Features       
-----------  ------------------  ---------  ---------------
16127779311  🇺🇸 United States    Mobile     MMS, SMS, VOICE
vonage apps numbers list 00000000-0000-0000-0000-000000000000

✅ Fetching Application
Fetching numbers linked to application Your application [==============] 1/1 100%

There is 1 number linked:

Number       Country             Type       Features       
-----------  ------------------  ---------  ---------------
16127779311  🇺🇸 United States    Mobile     MMS, SMS, VOICE
vonage apps numbers list 00000000-0000-0000-0000-000000000000 ✅ Fetching Application Fetching numbers linked to application Your application [==============] 1/1 100% There is 1 number linked: Number Country Type Features ----------- ------------------ --------- --------------- 16127779311 🇺🇸 United States Mobile MMS, SMS, VOICE

Vincular o desvincular un número a una aplicación

Los Numbers pueden enlazarse mediante vonage apps <link|unlink> <id> <msisdn>donde id es el UUID de la aplicación, y msisdn es el número que hay que vincular o desvincular.

Nota: los indicadores --app-id y --private-key se ignoran en este comando.

vonage apps numbers link 00000000-0000-0000-0000-000000000000 16127779311

✅ Fetching Application
Fetching Owned numbers [===============================================] 1/1 100%

Number linked

Number: 16127779311
Country: 🇺🇸 United States
Type: Toll-free
Features: MMS, SMS, VOICE
Monthly Cost: Not Set
Setup Cost: Not Set
Linked Application ID: 00000000-0000-0000-0000-000000000000
Voice Callback: app
Voice Callback Value: 00000000-0000-0000-0000-000000000000
Voice Status Callback: Not Set
vonage apps numbers link 00000000-0000-0000-0000-000000000000 16127779311

✅ Fetching Application
Fetching Owned numbers [===============================================] 1/1 100%

Number linked

Number: 16127779311
Country: 🇺🇸 United States
Type: Toll-free
Features: MMS, SMS, VOICE
Monthly Cost: Not Set
Setup Cost: Not Set
Linked Application ID: 00000000-0000-0000-0000-000000000000
Voice Callback: app
Voice Callback Value: 00000000-0000-0000-0000-000000000000
Voice Status Callback: Not Set
vonage apps numbers link 00000000-0000-0000-0000-000000000000 16127779311 ✅ Fetching Application Fetching Owned numbers [===============================================] 1/1 100% Number linked Number: 16127779311 Country: 🇺🇸 United States Type: Toll-free Features: MMS, SMS, VOICE Monthly Cost: Not Set Setup Cost: Not Set Linked Application ID: 00000000-0000-0000-0000-000000000000 Voice Callback: app Voice Callback Value: 00000000-0000-0000-0000-000000000000 Voice Status Callback: Not Set

Referencia