RTMP endpoints set to null when updating Antmedia broadcast - ant-media-server

I am using Ant Media REST to create broadcasts. It works fine however, the rtmp endpoints that I am adding through API are not visible in Ant Media server dashboard. But if I try to retrieve the broadcast using '/v2/broadcasts/{id}', the rtmp endpoints are there. When adding the endpoints through another api '/v2/broadcasts/{id}/rtmp-endpoint', I can see those endpoints in Ant Media server dashboard.
In addition, if I update an existing broadcast that contains rtmp endpoints, the rtmp endpoints value is set to null.
My question is are the above mentioned scenarios normal with the REST API or am I missing something?
Here is the snippet that I get when I retrieve the broadcast created using '/v2/broadcasts/create'.
{
"streamId": "xxxxxxxxxxxx",
"status": "created",
"type": "livestream",
"name": "Test Stream",
"description": "Boradtcast created using REST",
"publish": true,
"date": 1647407550785,
"plannedStartDate": 0,
"plannedEndDate": 0,
"duration": 0,
"endPointList": [
{
"type": "YouTube",
"broadcastId": "xxxxxx",
"streamId": "xxxxxxxxxxx",
"rtmpUrl": "rtmp://a.rtmp.youtube.com/live2/xxxxxxxxx",
"name": "test",
"endpointServiceId": "test",
"serverStreamId": null
}
],
"publicStream": true,
"is360": false,
"listenerHookURL": null,
"category": null,
"ipAddr": null,
"username": null,
"password": null,
"quality": "720p",
"speed": 0.0,
"streamUrl": null,
"originAdress": "xxxxxxxx",
"mp4Enabled": 0,
"webMEnabled": 0,
"expireDurationMS": 0,
"rtmpURL": "rtmp://xxxxxxx",
"zombi": false,
"pendingPacketSize": 0,
"hlsViewerCount": 0,
"webRTCViewerCount": 0,
"rtmpViewerCount": 0,
"startTime": 0,
"receivedBytes": 0,
"bitrate": 0,
"userAgent": "N/A",
"latitude": null,
"longitude": null,
"altitude": null,
"mainTrackStreamId": null,
"subTrackStreamIds": null,
"absoluteStartTimeMs": 0
}

You do not have to define all the fields in the create broadcast object. Only change your required fields like below example and other parameters will be set by default.
​
{
"streamId": "test",
"name": "Test Stream",
"endPointList": [
{
"status": "created",
"type": "generic",
"rtmpUrl": "rtmp://a.rtmp.youtube.com/live2/xxxxxxxxx"
}
]
}

Related

How to pass the ACF field to the REST API

I am passing a post request to Insomnia via the REST API to an arbitrary record type.
Title goes well and has the following structure
name: title value : Hello world
But the ACF fields come empty
I add to the request
name: poleacf, and value: Field text
But I only get the name and the fields come empty
This is how the structure looks like:
"id": 242,
"date": "2022-08-24T12:34:44",
"date_gmt": "2022-08-24T09:34:44",
"guid": {
"rendered": "https:\/\/mymerro.xn----gtbemkpb3brp9h.xn--p1ai\/?post_type=reviews&p=242",
"raw": "https:\/\/mymerro.xn----gtbemkpb3brp9h.xn--p1ai\/?post_type=reviews&p=242"
},
"modified": "2022-08-24T12:34:44",
"modified_gmt": "2022-08-24T09:34:44",
"password": "",
"slug": "",
"status": "draft",
"type": "reviews",
"link": "/?post_type=reviews&p=242",
"title": {
"raw": "Привет",
"rendered": "Привет"
},
"featured_media": 0,
"template": "",
"meta": {
"inline_featured_image": false
},
"permalink_template": "https:\/\/mymerro.xn----gtbemkpb3brp9h.xn--p1ai\/reviews\/%pagename%\/",
"generated_slug": "privet",
"acf": {
"opisanie": null,
"nazvanie_sobytiya": null,
"nazvanie_kompanii": null,
"otzyv_aktiven": null,
"oczenka": null,
"autor": null
},
Please help me correctly register the QUERY values in Insomnia so that the fields with ACF also do not come empty

How to create widget in a single AWS Cloud Watch dashboard for a list of instances

Terraform (aws provider) beginner here. I am trying to create aws-cloudwatch widget that graphs CPU Utilization for 3 instances. However, I only get one graph generated for the last instance in the list instead three graphs on one widget! How can I fix this please or get this How can I get this code to create CPUUtilisation graph for three instances on the same widget? Thank you
variable "targets" {
default = ["i-086e06769b6c67665","i-0477b6f25ad155290","i-0e6320273511d17dc"]
}
resource "aws_cloudwatch_dashboard" "ec2" {
dashboard_name = "ec2-test-dashboard"
count = length(var.targets)
dashboard_body = <<EOF
{
"widgets": [
{
"type": "metric",
"x": 0,
"y": 0,
"width": 17,
"height": 8,
"properties": {
"metrics": [
["AWS/EC2","CPUUtilization","InstanceId","${(var.targets[count.index])}"]
],
"title": "EC2 dashboard: CPUUtilization",
"stat": "Average",
"period": 300,
"stacked": false,
"view": "timeSeries",
"region": "eu-west-1",
"annotations": {
"horizontal": [
{
"label": "critical range",
"value": 10
}
]
},
"legend": {
"position": "right"
}
}
}
]
}
EOF
}

Stripe: getting "You cannot request any capability other than `transfers`" when only requesting transfers

I'm setting up a test connect account through Stripe, but for some reason during the onboarding I get:
You cannot request any capability other than transfers for accounts that are under the recipient service agreement.
even though I set the capabilities only to transfers.requested: true.
Full details:
1. I created a connect account
Request:
POST https://api.stripe.com/v1/accounts
x-www-form-urlencoded body:
tos_acceptance[service_agreement]: recipient
capabilities[transfers][requested]: true
country: AT
type: express
Response:
{
"id": "acct_1IEKs6Q5kVIyiDKZ",
"object": "account",
"business_profile": {
"mcc": null,
"name": null,
"product_description": null,
"support_address": null,
"support_email": null,
"support_phone": null,
"support_url": null,
"url": null
},
"business_type": null,
"capabilities": {
"transfers": "inactive"
},
"charges_enabled": false,
"country": "AT",
"created": 1611780255,
"default_currency": "eur",
"details_submitted": false,
"email": null,
"external_accounts": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/accounts/acct_1IEKs6Q5kVIyiDKZ/external_accounts"
},
"login_links": {
"object": "list",
"total_count": 0,
"has_more": false,
"url": "/v1/accounts/acct_1IEKs6Q5kVIyiDKZ/login_links",
"data": []
},
"metadata": {},
"payouts_enabled": false,
"requirements": {
"current_deadline": null,
"currently_due": [
"business_type",
"external_account",
"tos_acceptance.date",
"tos_acceptance.ip"
],
"disabled_reason": "requirements.past_due",
"errors": [],
"eventually_due": [
"business_type",
"external_account",
"tos_acceptance.date",
"tos_acceptance.ip"
],
"past_due": [
"business_type",
"external_account",
"tos_acceptance.date",
"tos_acceptance.ip"
],
"pending_verification": []
},
"settings": {
"bacs_debit_payments": {},
"branding": {
"icon": null,
"logo": null,
"primary_color": null,
"secondary_color": null
},
"card_payments": {
"decline_on": {
"avs_failure": false,
"cvc_failure": false
},
"statement_descriptor_prefix": null
},
"dashboard": {
"display_name": "Some business LLC",
"timezone": "Etc/UTC"
},
"payments": {
"statement_descriptor": null,
"statement_descriptor_kana": null,
"statement_descriptor_kanji": null
},
"payouts": {
"debit_negative_balances": false,
"schedule": {
"delay_days": 7,
"interval": "daily"
},
"statement_descriptor": null
},
"sepa_debit_payments": {}
},
"tos_acceptance": {
"date": null,
"ip": null,
"service_agreement": "recipient",
"user_agent": null
},
"type": "express"
}
2. Got the onboarding link:
Request:
POST https://api.stripe.com/v1/accounts
x-www-form-urlencoded body:
account: acct_1IEKs6Q5kVIyiDKZ
refresh_url: https://example.com/reauth
return_url: https://example.com/return
type: account_onboarding
Response:
{
"object": "account_link",
"created": 1611780861,
"expires_at": 1611781161,
"url": "https://connect.stripe.com/express/onboarding/<some string>"
}
3. Went to the onboarding link
I got an error after pressing Next on the Tell us about your business section.
You cannot request any capability other than transfers for accounts that are under the recipient service agreement. For more information on recipient service agreements, see https://stripe.com/docs/connect/service-agreement-types#recipient.
Why does stripe think I'm requesting capabilities other than transfers?
Stripe got back to me:
The error is a bit cryptic but it is likely due to the way you configured Connect Onboarding in your settings in the Dashboard. This error happens because we try to request the card_payments capability for this account but it's not supported because you use the recipient agreement type. The reason we ask for that capability comes from the fact that you configured Connect to require that capability for European accounts. You can change this default behaviour in your dashboard settings in Test mode here: https://dashboard.stripe.com/test/settings/applications/express (and you would do the same for Live mode). With your flow you want only Transfers as a capability.
The suggestion worked:
Incorrect Settings:
Correct Settings:
It's strange because I used to be able to create accounts from these requests. So the settings must have changed at some point. But to my knowledge I never went and changed them.

Not able to retrieve results from Open TSDB via HTTP

I have set up open TSDB using docker image. I am able to push data to database via HTTP post request.
[{
"metric": "sys.cpu.nice",
"timestamp": 1567764102,
"value": 18,
"tags": {
"host": "web01",
"dc": "lga"
}
},
{
"metric": "sys.cpu.abc",
"timestamp": 1567764602,
"value": 9,
"tags": {
"host": "web02",
"dc": "lga"
}
}
]
Same data is also visible on the portal but I want to retrieve this data form TSDB by API.
I used this but it's not returning actual data.
http://localhost:4242/api/search/lookup?m=sys.cpu.nice{host=*}
{
"type": "LOOKUP",
"metric": "sys.cpu.nice",
"tags": [{
"key": "host",
"value": "*"
}],
"limit": 25,
"time": 6.0,
"results": [],
"startIndex": 0,
"totalResults": 0
}
Could you please help to get data back from the database. I need to send this data to some other system.
Try using the /api/query endpoint
In your case you could try one of the following GET requests:
http://localhost:4242/api/query?m=sum:cmp.sys.db{host=server01,tenant01}&start=1h-ago
http://localhost:4242/api/query?m=zimsum:cmp.sys.db{host=server01,tenant01}&start=1h-ago

Hubo - How to get flow / thread users

How to get the users list from the current flow / thread with Hubot on Flowdock? I'd like to create plugin showing messages with the usage of current flow user names.
I have found this: robot.brain.data.users
but it returns the whole list of users from organization rather than from the current flow.
The list of a flow’s users can be fetched using the Flows resource. You'll need to know the Organization name and Flow name. See the 'Get a Flow' section here:
https://www.flowdock.com/api/flows
The format is:
GET /flows/:organization/:flow
and returns:
{
"id": "deadbeefdeadbeef",
"name": "My flow",
"parameterized_name": "my-flow",
"organization": {
"id": 8,
"name": "Acme",
"parameterized_name": "acme",
"user_limit": 0,
"user_count": 5,
"active": true,
"url": "https://api.flowdock.com/organizations/acme"
}
"unread_mentions": 0,
"open": true,
"url": "https://api.flowdock.com/flows/acme/my-flow",
"web_url": "https://www.flowdock.com/app/acme/my-flow",
"join_url": "https://www.flowdock.com/invitations/eedd2bf0643f75c14be9099272429351c7132a71-my-flow",
"access_mode": "link",
"users": [
{
"id": 9,
"nick": "Joe",
"name": "Joe Smith",
"email": "joe#example.com",
"avatar": "https://d2cxspbh1aoie1.cloudfront.net/avatars/f5b8fb60c6116331da07c65b96a8a1d1/",
"status": "Testing API",
"disabled": false,
"last_activity": 1328016726423000,
"last_ping": 1328017690004000
},
{
"id": 42,
"nick": "Stevie",
"name": "Stevie Johnson",
"email": "stevie#example.com",
"avatar": "https://d2cxspbh1aoie1.cloudfront.net/5bdd089a099acc56fc7120f6325a5d5c/",
"status": null,
"disabled": false,
"last_activity": 1328016712345000,
"last_ping": 1328017612345000
}
]
}

Resources