PropertySets at environment level not returning values

anonev
New Member

We've uploaded a property set using the management API:

curl -X POST "https://apigee.googleapis.com/v1/organizations/...-dev-apigeepoc/environments/apigeepoc/resourcefiles?name=envConfig&type=properties"  -H "Authorization: Bearer ya29.c.Kp8B9gencm-.........."   -H "Content-type: multipart/form-data"   -F file=envConfig.properties 

When trying to get the list of the available property sets, we can see this one is present.

curl -X GET "https://apigee.googleapis.com/v1/organizations/...-dev-apigeepoc/environments/apigeepoc/resourcefiles/properties"   -H "Authorization: Bearer ya29.c.Kp8B9gencm-................."
{
    "resourceFile": [
      {
        "name": "envConfig",
        "type": "properties"
      },
      {
        "name": "test",
        "type": "properties"
      }
    ]
  } 

One of the issues we face is that when we try to get the content of the property set via the management api (as described in the documentation) instead of the content we get just the file name:

curl -X GET "https://apigee.googleapis.com/v1/organizations/...-dev-apigeepoc/environments/apigeepoc/resourcefiles/properties/envConfig"   -H "Authorization: Bearer ya29.c.Kp8B9gencm-.............."
envConfig.properties

The other issue is accessing the values from the environment scoped property set at runtime. I've created a sample proxy to try accessing the values but with this proxy we can access only the API level property set values and not the environment ones. It uses both javaScript and AssignMessage policies to try accessing the env level property sets but with no success. Please find attached the sample proxy and the property file itself.

Solved Solved
2 2 217
1 ACCEPTED SOLUTION

Hi Andrey,

That's a nasty single char one to spot. You missed the `@` in -F file=@envConfig.properties so it actually wrote it literally to the properties file.

View solution in original post

2 REPLIES 2

Hi Andrey,

That's a nasty single char one to spot. You missed the `@` in -F file=@envConfig.properties so it actually wrote it literally to the properties file.

anonev
New Member

Thanks Daniel,

You're right 🙂

Using the '@' when uploading the file is addressing all the issues we've had.

Thanks again 🙂