Ir para o conteúdo principal

Gerenciando Assinaturas

Você pode gerenciar suas assinaturas usando os seguintes endpoints de API .

Pré-requisitos

  • Envie suas credenciais de usuário, ID do cliente e segredo do cliente para autenticação OAuth2. Consulte Autenticação de API para obter mais informações sobre como autenticar suas solicitações à API da Equinix.

Obtenha suas assinaturas

Para retornar uma lista de todas as suas assinaturas de streaming, envie uma solicitação GET para o endpoint /smartview/v2/streaming/subscriptions.

Exemplo de solicitação cURL:

curl -X
GET 'https://api.equinix.com/smartview/v2/streaming/subscriptions'
-H 'authorization: Bearer <token>'

Exemplo de resposta:

[
{
"id": "606349eca6171829c70d8777",
"status": "PENDING",
"messageType": {
"asset": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"assetClassification": [
"MECHANICAL"
],
"assetId": [
"string"
]
}
],
"environmental": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"level": [
"ZONE"
]
}
],
"power": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"meteredPower": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"systemAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"customAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"user": "abc"
}
]
},
"channel": {
"channelType": "AWS_IOT_CORE",
"awsIotCoreChannelConfiguration": {
"url": "https://b4c3mzxe8syvhd-ats.iot.us-west-2.amazonaws.com"
}
},
"orgId": "123",
"createdBy": "abc",
"createdDateTime": "2019-08-24T14:15:22Z",
"updatedBy": "abc",
"updatedDateTime": "2019-08-24T14:15:22Z"
}
]

Obtenha detalhes de assinaturas

Para obter os detalhes de uma assinatura específica, envie uma solicitação GET para o endpoint /smartview/v2/streaming/subscriptions/{id}.

Exemplo de solicitação cURL:

curl -X
GET 'https://api.equinix.com/smartview/v2/streaming/subscriptions/606349eca6171829c70d8777'
-H 'authorization: Bearer <token>'

Exemplo de resposta:

{
"id": "606349eca6171829c70d8777",
"status": "ACTIVE",
"messageType": {
"asset": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"assetClassification": [
"MECHANICAL"
],
"assetId": [
"string"
]
}
],
"environmental": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"level": [
"ZONE"
]
}
],
"power": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"meteredPower": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"systemAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"customAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"user": "abc"
}
]
},
"channel": {
"channelType": "AWS_IOT_CORE",
"awsIotCoreChannelConfiguration": {
"url": "https://b4c3mzxe8syvhd-ats.iot.us-west-2.amazonaws.com"
}
},
"orgId": "123",
"createdBy": "abc",
"createdDateTime": "2019-08-24T14:15:22Z",
"updatedBy": "abc",
"updatedDateTime": "2019-08-24T14:15:22Z"
}

Atualizar uma assinatura

Para modificar uma assinatura, envie uma solicitação PUT para o endpoint /smartview/v2/streaming/subscriptions/{id}. O novo corpo da solicitação substitui a configuração atual da assinatura.

Exemplo de solicitação cURL:

curl -X
PUT 'https://api.equinix.com/smartview/v2/streaming/subscriptions/{id}'
-H 'authorization: Bearer <token>'
-d '{
"messageType": {
"asset": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"assetClassification": [
"MECHANICAL"
],
"assetId": [
"string"
]
}
],
"environmental": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"level": [
"ZONE"
]
}
],
"power": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"meteredPower": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"systemAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
]
}
],
"customAlert": [
{
"accountNumber": "135888",
"ibx": [
"DE2"
],
"user": "abc"
}
]
},
"channel": {
"channelType": "AWS_IOT_CORE",
"awsIotCoreChannelConfiguration": {
"url": "https://b4c3mzxe8syvhd-ats.iot.us-west-2.amazonaws.com"
}
}
}'

Eliminar uma Assinatura

Para excluir uma assinatura, envie uma solicitação DELETE para o endpoint /smartview/v2/streaming/subscriptions/{id}. Os eventos não estarão mais disponíveis para a assinatura após o recebimento da solicitação de exclusão.

Exemplo de solicitação cURL:

curl -X
DELETE 'https://api.equinix.com/smartview/v2/streaming/subscriptions/606349eca6171829c70d8777'
-H 'authorization: Bearer <token>'
Esta página foi útil?