Wowza Community

Curl command to create mediacache with google storage source (credentials issue)

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' \ \

-d '


    "type": "GoogleCloudStorage",

    "basePath": "",

    "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": "",

    "googleServiceKey": {

        "type": "service_account",

        "project_id": "some-project",

        "private_key_id": "XXXXXXXXXXX",


        "client_email": "",

        "client_id": "115155345353555353",

        "auth_uri": "",

        "token_uri": "",

        "auth_provider_x509_cert_url": "",

        "client_x509_cert_url": ""


    "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:[\"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.

Checking with an REST API engineer for you…

You essentially have to get a hash of that code that you included @Justin Cooke. If you are using the JSON authenticationType, you will need to change the \n characters in the JSON file you downloaded to a newline, and then Base64 to UTF-8 charset the private_key value from the JSON file. You can use any online tool to do this (such as Use the output in the secretAccessKey parameter.

Each GCE account would have its own key, that they need to convert to a hash.

Those keys are found in a JSON file that you got from Google site.

It sounds like you have the json file already, You just need direction on how to obtain the hash.

Please submit a ticket if you have any issues. Thanks.