mediaReaderRandomAccessReaderClass issue with wowza restful api - api

I am using WowzaStreamingEngine 4.4.1 at Ubuntu 14.04. I used restful api and created vod application (restful_vod) as in examples, it didn't work didn't stream vod files. That's why, I compare application.xml files of default vod application and restful_vod application. There is a difference between MediaReader properties. Default vod application has no property at there but restful_vod has below:
<MediaReader>
<!-- Properties defined here will override any properties defined in conf/MediaReaders.xml for any MediaReaders loaded by this applications -->
<Properties>
<Property>
<Name>randomAccessReaderClass</Name>
<Value></Value>
<Type>String</Type>
</Property>
</Properties>
</MediaReader>
When I removed randomAccessReaderClass named property, it started to work. I realized mediaReaderRandomAccessReaderClass parameter manage its value at restful api side. But I couldn't find a way to prevent adding it while using restful api. I tried not setting mediaReaderRandomAccessReaderClass value and also setting mediaReaderRandomAccessReaderClass false, null and empty string.
Is there any way to prevent adding it or a default working value for this?
Thanks.

You can set a default mediaReaderRandomAccessReaderClass by setting it as follows:
"mediaReaderRandomAccessReaderClass": ""
In your resulting Application.xml file, the MediaReader container would then be blank, which would indicate that it would use the default value:
<MediaReader>
<!-- Properties defined here will override any properties defined in conf/MediaReaders.xml for any MediaReaders loaded by this applications -->
<Properties>
</Properties>
</MediaReader>
A working REST API command to create a VOD file, for example, would look like this.
curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testvod -d'
{
"restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testvod",
"version": "1462342478287",
"name": "testvod",
"appType": "VOD",
"description": "Test VOD via REST.",
"applicationTimeout": 0,
"pingTimeout": 0,
"repeaterQueryString": "",
"clientStreamReadAccess": "*",
"avSyncMethod": "senderreport",
"maxRTCPWaitTime": 12000,
"httpStreamers": [
"cupertinostreaming",
"smoothstreaming",
"sanjosestreaming",
"mpegdashstreaming"
],
"mediaReaderRandomAccessReaderClass": "",
"httpOptimizeFileReads": false,
"mediaReaderBufferSeekIO": false,
"captionLiveIngestType": "",
"vodTimedTextProviders": [
"vodcaptionprovidermp4_3gpp"
],
"securityConfig": {
"restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testvod/security",
"secureTokenVersion": 0,
"clientStreamWriteAccess": "*",
"publishRequirePassword": true,
"publishPasswordFile": "",
"publishRTMPSecureURL": "",
"publishIPBlackList": "",
"publishIPWhiteList": "",
"publishBlockDuplicateStreamNames": false,
"publishValidEncoders": "",
"publishAuthenticationMethod": "digest",
"playMaximumConnections": 0,
"playRequireSecureConnection": false,
"secureTokenSharedSecret": "",
"secureTokenUseTEAForRTMP": false,
"secureTokenIncludeClientIPInHash": false,
"secureTokenHashAlgorithm": "",
"secureTokenQueryParametersPrefix": "",
"secureTokenOriginSharedSecret": "",
"playIPBlackList": "",
"playIPWhiteList": "",
"playAuthenticationMethod": "none"
},
"streamConfig": {
"restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testvod/streamconfiguration",
"streamType": "default",
"storageDir": "${com.wowza.wms.context.VHostConfigHome}/content",
"createStorageDir": false,
"storageDirExists": true,
"keyDir": "${com.wowza.wms.context.VHostConfigHome}/keys",
"httpRandomizeMediaName": false
},
"modules": {
"restURI": "http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/testvod/modules",
"moduleList": [
{
"order": 0,
"name": "base",
"description": "Base",
"class": "com.wowza.wms.module.ModuleCore"
},
{
"order": 1,
"name": "logging",
"description": "Client Logging",
"class": "com.wowza.wms.module.ModuleClientLogging"
},
{
"order": 2,
"name": "flvplayback",
"description": "FLVPlayback",
"class": "com.wowza.wms.module.ModuleFLVPlayback"
},
{
"order": 3,
"name": "ModuleCoreSecurity",
"description": "Core Security Module for Applications",
"class": "com.wowza.wms.security.ModuleCoreSecurity"
}
]
}
}'

Related

How to update Product Custom Attribute with media_image type via REST API in Magento 2.4

I'd like to know how I can update the product custom attribute defined as media_image type via REST API in Magento 2.4.4.
My custom attribute is defined like the following:
{
"is_wysiwyg_enabled": false,
"is_html_allowed_on_front": true,
"used_for_sort_by": false,
"is_filterable": false,
"is_filterable_in_search": false,
"is_used_in_grid": true,
"is_visible_in_grid": true,
"is_filterable_in_grid": true,
"position": 0,
"apply_to": [],
"is_searchable": "0",
"is_visible_in_advanced_search": "0",
"is_comparable": "0",
"is_used_for_promo_rules": "0",
"is_visible_on_front": "0",
"used_in_product_listing": "0",
"is_visible": true,
"scope": "website",
"attribute_id": 185,
"attribute_code": "custom_pic",
"frontend_input": "media_image",
"entity_type_id": "4",
"is_required": false,
"options": [],
"is_user_defined": true,
"default_frontend_label": "custom_pic",
"frontend_labels": [
{
"store_id": 1,
"label": "Custom Picture"
}
],
"backend_type": "varchar",
"is_unique": "0",
"validation_rules": []
}
But I don't know how to update it and can't find the proper documentation.
I can update other custom attributes successfully by endpoint /rest/default/V1/products/{sku}
I tried the following so far:
Tried to pass a valid URL in value. But didn't work!
{
"attribute_code": "custom_pic",
"value": "https://xxxx/.../xxx.png"
}
Tried to base64 encoded string. (Because we can update product images by base64 encoded string.) But no luck!
Could you help me out, please?

Azure Devops API Release definitions expand recursively (I need workflowTasksfrom deployPhases from environments)

Does the Azure Devops REST API allow me to expand multiple levels? When using the release definitions I specifically need the workflowtasks, which are buried a couple of lists deep.
More context:
I'm optimizing an Azure Devops extension that scans pipelines for compliancy. Right now there's a rule that scans the workflowtasks. To get the information required on all relevant pipelines, we do the following call to the Azdo API for each release definition:
https://vsrm.dev.azure.com/{Organization}/{Project}/_apis/release/definitions/{definitionID}?api-version=6.0
This returns a completely decked-out release definition including environments like this:
"environments": [{
"id": 10,
"name": "Stage 1",
... etc
"deployPhases": [{
"deploymentInput": {
"parallelExecution": {
"parallelExecutionType": "none"
},
...etc
"rank": 1,
...etc
"workflowTasks": [{
"environment": {},
"taskId": "obfuscated",
"version": "2.*",
"name": "obfuscated",
"refName": "",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"retryCountOnTaskFailure": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"template": "obfuscated",
"assets": "obfuscated",
"duration": "60",
"title": "",
"description": "",
"implementationPlan": "obfuscated"
}
}, {
"environment": {},
"taskId": "obfuscated",
"version": "2.*",
"name": "obfuscated",
"refName": "",
"enabled": true,
"alwaysRun": false,
"continueOnError": false,
"timeoutInMinutes": 0,
"retryCountOnTaskFailure": 0,
"definitionType": "task",
"overrideInputs": {},
"condition": "succeeded()",
"inputs": {
"changeClosureCode": "1",
"changeClosureComments": "Successful implementation",
"changeId": ""
}
}
]
}
],
...etc
}
],
But when I try and get the list as a whole, using the following URL:
https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions?$expand=environments&api-version=6.0
My Environments arrays (there is one for each definition obviously) looks nothing like the previous one. It doesn't include deployPhases (not even as an empty array).
Since we have 2300 release definitions, you can Imagine how inconvenient it is to call the release/definitions/{definitionID} endpoint instead of the release/definitions one that fetches all of them at the same time.
Is there a way to expand the release/definitions call to fetch all environments including workflowTasks and maybe other stuff? Is there a syntax that allows for this? Something like $expand=environments>deployPhases>workflowTasks?
Is there a way to expand the release/definitions call to fetch all environments including workflowTasks and maybe other stuff? Is there a syntax that allows for this? Something like $expand=environments>deployPhases>workflowTasks?
I am afraid there is no such syntax allow you to fetch all environments including workflowTasks.
You could use the REST API with some powershell scripts to fetch all environments including workflowTasks:
The sample powershell scripts:
$url = "https://vsrm.dev.azure.com/{Organization}/{Project}/_apis/release/definitions/{definitionID}?api-version=6.0"
Write-Host "URL: $url"
$pipeline = Invoke-RestMethod -Uri $url -Method Get -Headers #{
Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"
}
Write-Host "workflowTasks = $($pipeline.environments.deployPhases.workflowTasks | ConvertTo-Json -Depth 100)"
The output is:

Why is "create" undefined for Edge extension notifications?

Running code in Edge extension throws a TypeError, unable to get property 'create' of undefined or null reference.
I have tried running it in both the popup and background scripts. I have the notifications permissions in the manifest. I did see that some APIs require being run in the content script, but since I'm not engaging the tabs or web pages, I don't think that applies to me...?
Manifest:
{
"name": "xxx",
"author": "xxx", "version": "1.1",
"options_page": "options.html",
"background": {
"scripts": ["jquery-3.3.1.min.js","background.js"], "persistent": true
},
"permissions": [
"xxx",
"background",
"notifications",
"storage"
],
"offline_enabled": true,
"browser_action": {
"default_title": "xxx",
"default_popup": "popup.html",
"default_icon": "32.png"
},
"manifest_version": 2
}
Background script:
try{
browser.notifications.create("test",{
"type": "basic",
"title": "Test",
"iconUrl": "48.png",
"message": "This is a test"
});
}catch(e){
alert(e);
}
Based on your description, first, you could try to upgrade the Edge browser to the latest version, then, try to use the browser.notifications.create method.
But, in my opinion, I prefer to display the notification using the Web Notifications API, you could check this article.

Ember - Cannot read property 'replace' of undefined

My application
Im trying to build a fairly simple application using Laravel as a RESTfull API server and Ember as my fontend framework
My backend server lives on http://api.example.com/1.0/
My frontend lives on http://www.example.com/
Ive just started this project so I'm only a few hours into the devlopment, so there might be some configuration issues that Im missing here, but anyway.
Im trying to get a list of products from my server and display them in my ember application using ember-data
Im running ember 2.0.2 and ember-data 2.0.0
Im getting the following error in chrome.
Error
Error while processing route: product Cannot read property 'replace'
of undefined TypeError: Cannot read property 'replace' of undefined
at Object.func (http://localhost:4200/assets/vendor.js:45832:15)
at Object.Cache.get (http://localhost:4200/assets/vendor.js:23421:36)
at decamelize (http://localhost:4200/assets/vendor.js:45874:29)
at Object.func (http://localhost:4200/assets/vendor.js:45789:12)
at Object.Cache.get (http://localhost:4200/assets/vendor.js:23421:36)
at Object.dasherize (http://localhost:4200/assets/vendor.js:45878:35)
at ember$data$lib$system$normalize$model$name$$normalizeModelName (http://localhost:4200/assets/vendor.js:66295:27)
at ember$data$lib$serializers$json$serializer$$default.extend.modelNameFromPayloadKey
(http://localhost:4200/assets/vendor.js:75184:67)
at ember$data$lib$serializers$json$serializer$$default.extend._normalizeResourceHelper
(http://localhost:4200/assets/vendor.js:75064:30)
at Array.map (native)
Files
In ember I have generated a product resource giving my the following files.
// app/routes/product.js
import Ember from 'ember';
export default Ember.Route.extend({
model() {
return this.store.findAll('product');
}
});
// app/model/product.js
import DS from 'ember-data';
export default DS.Model.extend({
name: DS.attr(),
price: DS.attr()
});
JSON response
The Json returned from my api http://api.example.com/1.0/products
{
"data": [
{
"id": "1",
"name": "dolores",
"price": "59015",
"created_at": "2015-09-06 16:18:13",
"updated_at": "2015-09-06 16:18:13"
},
{
"id": "2",
"name": "debitis",
"price": "57449",
"created_at": "2015-04-07 14:45:16",
"updated_at": "2015-04-07 14:45:16"
},
...
]
}
This is adapter/serializer error, it's not descriptive though. Payload is wrong for the JSONAPIAdapter (the default adapter)
You should modify payload as:
{
"data": [
{
"id": "1",
"type": "products",
"attributes": {
"name": "dolores",
"price": "59015",
"created-at": "2015-09-06 16:18:13",
"updated-at": "2015-09-06 16:18:13"
}
}, {
"id": "2",
"type": "products",
"attributes": {
"name": "debitis",
"price": "57449",
"created-at": "2015-04-07 14:45:16",
"updated-at": "2015-04-07 14:45:16"
}
}]
}
or use RESTAdapter/Serializer with a such payload:
{
"products": [{
"id": "1",
"name": "dolores",
"price": "59015",
"created_at": "2015-09-06 16:18:13",
"updated_at": "2015-09-06 16:18:13"
}, {
"id": "2",
"name": "debitis",
"price": "57449",
"created_at": "2015-04-07 14:45:16",
"updated_at": "2015-04-07 14:45:16"
}]
}
If you can't change response payload, you have to customize Adapter/Serializer pair. Check related questions on SO.
Links for details:
Guides
JSONAPISerializer payload example
RESTSerializer payload example
The same issue happened to me.
Version details:
DEBUG: -------------------------------
ember.debug.js:DEBUG: Ember : 1.11.0
ember.debug.js:DEBUG: Ember Data : 1.0.0-beta.14.1
ember.debug.js:DEBUG: jQuery : 1.11.1
DEBUG: -------------------------------
Cause of the issue:
It seems that adding attributes to Handlebars elements using inline if helpers also causes the issue (whether the property that you are using on your condition is true, false, null or undefined).
my-component.hbs
<button class="btn btn-solve-my-problems" {{action 'solveIt}} {{if isNotSolvable 'disabled'}}>
Solve my problems!
</button>
my-component.coffee
isNotSolveble: (->
if #get('somethingMeaningful') then true else null
).property('somethingMeaningful')
The solution:
Instead of using the inline if helper, I am just attributing the value of isNotSolvable to the disabled attribute (nothing was changed on the my-component.coffee file).
my-component.hbs
<button class="btn btn-solve-my-problems" {{action 'solveIt}} disabled="{{isNotSolvable}}">
Solve my problems!
</button>
PS.: the null being returned from the method has to do with the manipulation of the disabled attribute. It has nothing to do with the issue reported on this thread. It only reflects my scenario and how I've solved the issue. More details here.

Yodlee getSiteLoginForm API response changes between attempts

There seems to be an inconsistency with the responses for Yodlee's getSiteLoginForm REST API function.
For a site that has a login field with radio buttons, sometimes the data coming back from Yodlee for that particular field will look like this:
{
"fieldInfoList": [
{
"validValues": [
"1",
"2",
"3",
"4"
],
"displayValidValues": [
"1",
"2",
"3",
"4"
],
"valueIdentifier": "OPTIONS",
"valueMask": "LOGIN_FIELD",
"fieldType": {
"typeName": "OPTIONS"
},
"size": 20,
"maxlength": 40,
"name": "OPTIONS",
"displayName": "Issue Number",
"isEditable": true,
"isOptional": false,
"isEscaped": false,
"helpText": "76367",
"isOptionalMFA": false,
"isMFA": false
}
]
}
and other times it looks like this:
{
"validValues": [
"1",
"2",
"3",
"4"
],
"displayValidValues": [
"1",
"2",
"3",
"4"
],
"valueIdentifier": "OPTION",
"valueMask": "LOGIN_FIELD",
"fieldType": {
"typeName": "OPTIONS"
},
"size": 20,
"maxlength": 40,
"name": "OPTION",
"displayName": "Issue Number",
"isEditable": true,
"isOptional": false,
"isEscaped": false,
"helpText": "76367",
"isOptionalMFA": false,
"isMFA": false
}
It's the same field but the valueIdentifier value has changed and the data isn't being enclosed in a fieldInfoList variable.
What would be the reason for this response data-set changing between two attempts if there's no difference in the code?
In addition to that, could a similar response inconsistency be affecting other API functions from Yodlee, and if so how does one deal with this uncertain variance?
We did analysis and Yodlee provides every time same response, no matter how many attempts you'll do. While I am assuming that you might be confused between getSiteLoginForm and getLoginFomForContentService, as both are two different APIs and belongs to approach i.e., Site Based and Container Based respectively. And the response you have mentioned first comes when you use getSiteLoginForm while the later one comes with getLoginFormForContentService.
Hope this helps as there is no issue with the API, these are two different response from 2 different APIs.