kinesis firehose endpoint missing - amazon-kinesis-firehose

I have set-up firehose to collect data through agent and push it to elasticasearch. It works for a single record using pyhon code. But I am not able to send data using Kinesis Agent.
As per the documentation, there should be firehose and kinesis endpoints. But there is no such endpoint available.
https://docs.aws.amazon.com/firehose/latest/dev/writing-with-agents.html
{
"cloudwatch.emitMetrics": true,
"kinesis.endpoint": "https://your/kinesis/endpoint",
"firehose.endpoint": "https://your/firehose/endpoint",
"flows": [
{
"filePattern": "/tmp/app1.log*",
"kinesisStream": "yourkinesisstream"
},
{
"filePattern": "/tmp/app2.log*",
"deliveryStream": "yourfirehosedeliverystream"
}
]
}
I can not find firehose endpoint. What all I have is the Delivery stream name.

The documentation link you referenced has the value for the Firehose endpoint, but that wouldn't help you for your Kinesis endpoint.
The endpoints depend on the region you're writing to. The default for the Amazon Kinesis Agent is firehose.us-east-1.amazonaws.com.
https://docs.aws.amazon.com/firehose/latest/dev/writing-with-agents.html#agent-config-settings
Your best bet is to refer to the AWS Regions and Endpoints doc:
http://docs.aws.amazon.com/general/latest/gr/rande.html

Related

Can all of Flex be configured via an API

I'm looking to configure Twilio Flex only via code without using the UI. However, I'm stuck trying to find out how to enable the dial pad and caller ID details along with a few other settings.
Is everything able to be configured via an API/Terraform?
How can I find out the missing parts.
You can edit this information by Flex Configuration API.
Follow an example of a request that you can use:
Request method: POST
Request URL: https://flex-api.twilio.com/v1/Configuration?UiVersion=1.30.2 (The UiVersion will be the version of your environment, in this example, the version of the Flex is 1.30.2)
Authentication Type: Basic
Authentication credentials: accountSid:authToken (accountSid is the username and authToken is the password)
Request Body:
{
"account_sid": "ACXXXX",
"outbound_call_flows": {
"default": {
"workflow_sid": "WWXXXX",
"enabled": true,
"queue_sid": "WQXXXX",
"caller_id": "+551199998888",
"location": "BR"
}
}
account_sid -> The Account's account_sid (ACXXXX)
workflow_sid -> The Workflow that you want to configure for outbound calls, you can see existents workflows at Twilio Console following the path Taskrouter > Workspaces > Workflows (https://console.twilio.com/us1/develop/taskrouter/workspaces?frameUrl=/console/taskrouter/workspaces) (WWXXX)
queue_sid -> The Queue that you want to configure for outbound calls, you can see existents queues at Twilio Console following the path Taskrouter > Workspaces > Task Queues (https://console.twilio.com/us1/develop/taskrouter/workspaces?frameUrl=/console/taskrouter/workspaces) (WQXXX)
caller_id -> The Number that will be used for outbound calls, you can see the existents number at Twilio Console following the path Phone Numbers > Manage > Phone Numbers (https://console.twilio.com/us1/develop/phone-numbers/manage/incoming) (+...)
location -> The Location that will be used for outbound calls.
I hope that it can help you! :D
Unfortunately, this is not possible at the moment.

Getting shared with service account info or retrieve all docs shared with a specific service account?

I'm looking for a way to either
1) Read/retrieve share notifications whenever a Sheet is shared with a specific service account
or
2) Get a list of all Sheets shared with a specific service account
Background: Users duplicate an existing Sheet template, modify its contents and share it with my service account email so I can retrieve the Sheet data programmatically. This still requires the users to input the resulting share link into my backend after sharing.
Instead I'd prefer using the API to receive either something like a "shared with service account" webhook event or an option to read all Sheets shared with this service account.
Does this require GSuite, or is there an API/webhook to achieve this?
Answer:
Yes, you can retrieve this information with the Drive API.
More Information:
If you make a Drive: files.list call as a service account, it will return the files of the Service Account's Drive.
If your users are sharing Sheets with the Service Account, you can retrieve them by making an API call to this method with the sharedWithMe flag set to true, and the mimeType set to application/vnd.google-apps.spreadsheet in the q parameter.
JavaScript example:
function execute() {
return gapi.client.drive.files.list({
"q": "sharedWithMe and mimeType = 'application/vnd.google-apps.spreadsheet'"
})
.then(function(response) {
// Handle the results here (response.result has the parsed body).
console.log("Response", response);
},
function(err) { console.error("Execute error", err); });
}
References:
Files: list | Google Drive API
Search for files and folders | Google Drive API
G Suite and Drive MIME Types | Google Drive API

Failed to authenticate to Cloud IAP Backend from Cloud Tasks HTTP Request

I'm trying to use Cloud Tasks HTTP Requests to reach a Kubernetes endpoint behind an HTTPS Load Balancer protected by Cloud IAP.
The endpoint works using any Gsuite company account as it should be but when the Cloud Task executes this is the Cloud Audit - Data Access log (only important parts displayed)
authenticationInfo: {
}
authorizationInfo: [
0: {
permission: "iap.webServiceVersions.accessViaIAP"
resource: "projects/<PROJECT_NUMBER>/iap_web/compute/services/<SERVICE_NUMBER>/versions/bs_0"
resourceAttributes: {
service: "iap.googleapis.com"
type: "iap.googleapis.com/WebServiceVersion"
}
}
]
status: {
code: 7
message: "PERMISSION_DENIED"
}
I'm using the compute-engine service account to create the task so I've granted this account the appropriate permissions:
When I create the task I add the appropriate OIDC service account email to the http request
'oidc_token': {'service_account_email': <PROJECT_NUMBER>-compute#developer.gserviceaccount.com}}
I also checked the Cloud Tasks HTTP Request on another endpoint and the Authentication Bearer token is present.
I really don't have any idea at this point on how to make it work.
Thanks for the help
I found the problem, the OIDC needed a specific audience to work with Cloud IAP.
The audience needed is the IAP ClientID that could be found in API & Services > Credentials under the section OAuth 2.0 client IDs with a name starting with IAP.
Just as an example here is the python code to add a task that can be granted access by the Cloud IAP.
# This is the important part, the audience filed is very important!
oidc_token = {'service_account_email': <PROJECT_NUMBER>-compute#developer.gserviceaccount.com, 'audience': <PROJECT_NUMBER>-<NUMBER_GENERATED_AUTOMATICALLY_BY_IAP>.apps.googleusercontent.com}
http_request = {'http_method': 'POST', 'url': url, 'body': json.dumps(payload).encode(), 'headers': headers, 'oidc_token': oidc_token}
task['schedule_time'] = timestamp
created_task = client.create_task(parent, {'http_request': http_request})

Can we call External Rest API from Rule Chain to collect telemetry data from another API?

I am trying to collect energy generation statistics like Watts and wattHour form external API. I have External Rest API endpoint available for it.
Is there a way in Thingsboard using rule chain to call external endpoint and store its as telemetry data. Later i want to show this data in dashboards.
I know it has been too long, but thingsboard has lacking documentation and it might be useful for someone else.
You'd have to use the REST API CALL external node (https://thingsboard.io/docs/user-guide/rule-engine-2-0/external-nodes/#rest-api-call-node)
If the Node was successful, it will output it's OutboundMessage containing the HTTP Response, with the metadata containing:
- metadata.status
- metadata.statusCode
- metadata.statusReason
and with the payload of the message containing the response body from your external REST service (i.e. your stored telemetry).
You then have to use a script transformation node in order to format the metadata, payload and msgType, into the POST_TELEMETRY_REQUEST message format, see: https://thingsboard.io/docs/user-guide/rule-engine-2-0/overview/#predefined-message-types
Your external REST API should provide the correct "deviceName" and "deviceType", as well as the "ts" in UNIX milliseconds.
Notice that you also need to change the messageType (msgType return variable) to "POST_TELEMETRY_REQUEST".
Finally, just transmit the result to the Save timeseries action node and it will be stored as a telemetry from the specified device. Hope this helps.

SEMP API equivalent for url "/SEMP/v2/config/msgVpns/default"

URL .../SEMP/v2/config/msgVpns/default returns data
{
"data":{
"authenticationBasicEnabled":true,
"authenticationBasicProfileName":"default",
"authenticationBasicRadiusDomain":"",
"authenticationBasicType":"radius",
"authenticationClientCertAllowApiProvidedUsernameEnabled":false,
....
What is the Java API to return this data? Apparently there is no getMsgVpnsDefault(...) method
Generally speaking what is the translation of URL's into API calls? This doesn't seem to be addressed in the documentation.
What is the Java API to return this data? Apparently there is no getMsgVpnsDefault(...) method
There's no API provided by Solace.
SEMP(v2 in your case) is a series of REST commands to be executed over the management port to manage the configuration of the Solace routers.
This is not to be mistaken for the Java API that's provided for messaging over the messaging port/interface.
Generally speaking what is the translation of URL's into API calls?
The complete list of URL's is documented here:
https://docs.solace.com/API-Developer-Online-Ref-Documentation/swagger-ui/index.html#/
In the Solace Samples repository on GitHub there's a gradle file which uses Swagger CodeGen to generate a POJO wrapper around SEMP v2.
This then gives you a Java API to interact with Solace routers.
WRT your original question about getMsgVpnsDefault(...) I believe you'd use
MsgVpn defaultVPN = sempApiInstance.getMsgVpn("default", null);
Or you could grab the list of all VPNs
MsgVpnsResponse resp = sempApiInstance.getMsgVpns(1000, null, null, null);
List<MsgVpn> allVpsn = resp.getData();
then iterate over the list checking until you find one whose name is "default"
https://github.com/SolaceSamples/solace-samples-semp/tree/master/java

Resources