Hi I am trying to setup a mediacache with google cloud storage as a source using the rest API however I I am getting a jackson parse error due to the credentials not being what is expected. Can you please correct this curl command so that I can add the google credentials or advise how to encrypt.
curl -X POST \
-H 'Accept:application/json; charset=utf-8' \
-H 'Content-type:application/json; charset=utf-8' \
http://127.0.0.1:8087/v3/servers/_defaultServer_/mediacache/sources/media-store-prod-input-1 \
-d '
{
"type": "GoogleCloudStorage",
"basePath": "https://storage.googleapis.com/",
"prefix": "http/",
"minTimeToLive": 14400000,
"maxTimeToLive": 28800000,
"isAmazonS3": false,
"s3BucketNameInDomain": false,
"awsAccessKeyId": "",
"awsSecretAccessKey": "",
"isPassThru": false,
"baseClass": "com.wowza.wms.mediacache.impl.MediaCacheItemHTTPImpl",
"httpReaderFactoryClass": "com.wowza.wms.mediacache.impl.MediaCacheItemHTTPGoogleStorageFactory",
"azureAccountName": "",
"azureContainerName": "",
"azureAccountKey": "",
"googleServiceID": "some-cloud-storage-prod@myproject.iam.gserviceaccount.com",
"googleServiceKey": {
"type": "service_account",
"project_id": "some-project",
"private_key_id": "XXXXXXXXXXX",
"private_key": "-----BEGIN PRIVATE KEY-----\XXXXXXXXXXXXXXX\XXXXXXXXX+XXXXXXXXXX==\n-----END PRIVATE KEY-----\n",
"client_email": "some-cloud-storage-prod@myproject.iam.gserviceaccount.com",
"client_id": "115155345353555353",
"auth_uri": "https://accounts.google.xcom/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/someones-cloud-storage-prod%40myproject.iam.gserviceaccount.com"
},
"googleServicePrivateKeyFile": "",
"googleServicePrivateKeyPassword": "",
"googleEncMethod": "JSON"
}' | jq
I get the following response:
"message": "com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_OBJECT token\n at [Source: (ByteArrayInputStream); line: 19, column: 25] (through reference chain: com.wowza.wms.rest.server.mediacache.MediaCacheSourceConfig3[\"googleServiceKey\"])",
based the command by querying an instance I setup earlier and manually configured, but the key is just an encrypted string in that instance.
What is the correct way of doing this? I will inject the service account credentials in via an environment variable / secret in real life.