# An attempt to enable a snapshot by API fails

**URL:** <https://discuss.elastic.co/t/an-attempt-to-enable-a-snapshot-by-api-fails/186708>\
**Category:** Elastic Cloud Enterprise (ECE)\
**Created:** [June 20, 2019, 2:26pm UTC](https://discuss.elastic.co/t/an-attempt-to-enable-a-snapshot-by-api-fails/186708 "2019-06-20T14:26:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![osykora](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/osykora/32/41464_2.png) [@osykora](https://discuss.elastic.co/u/osykora)\
**Post date:** [June 20, 2019, 2:26pm UTC](https://discuss.elastic.co/t/an-attempt-to-enable-a-snapshot-by-api-fails/186708/1 "2019-06-20T14:26:11Z")

</div>

Hi,

I have an existing cluster and s3 repository created in ECE. When I want to enable snapshots for the cluster using an API call, I'm getting an error.

Request:

```
curl --request PATCH \
  --url {ece-url}/api/v1/clusters/elasticsearch/e2bf4e7e72274bd0ab8b6ba1ac7b9919/snapshot/settings \
  --header 'content-type: application/json' \
  --data '{
   "enabled" : true,
   "interval" : "1d",
   "pending_interval" : "1m",
   "repository" : {
		 "reference" : {
			 "repository_name": "cluster_repo_s3"
   }
   },
   "retention" : {
      "max_age" : "90d",
      "snapshots" : 90
   }
}'

```

Response:

```
{
  "errors": [
    {
      "code": "clusters.cluster_setting_error",
      "message": "Cluster Settings Error: Only one of reference/static/default repository configuration should be defined"
    }
  ]
}

```

Any thoughts on what I'm doing wrong?

Thank you,

Ondrej

---

<div class="post-metadata">

**Author:** ![zanbel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zanbel/32/20678_2.png) [@zanbel](https://discuss.elastic.co/u/zanbel)\
**Post date:** [June 28, 2019, 9:45am UTC](https://discuss.elastic.co/t/an-attempt-to-enable-a-snapshot-by-api-fails/186708/2 "2019-06-28T09:45:45Z")

</div>

hey @osykora,

One things that I notice is wrong time indication for minutes. Should be `min` and not `m`. I've tried using the following payload which worked fine for me. Maybe you can see if it works for you?  
One last thing, I assume you have repository configured with `cluster_repo_s3` as repo name.

```auto
{
    "repository": {
        "reference": {
            "repository_name": "cluster_repo_s3"
        }
    },
    "enabled": true,
    "interval" : "1d",
    "pending_interval" : "1min",
    "retention": {
    	"max_age" : "90d",
    	"snapshots" : 90
    }
}

```

P.s. I'm using latest version of ECE.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 12, 2019, 9:45am UTC](https://discuss.elastic.co/t/an-attempt-to-enable-a-snapshot-by-api-fails/186708/3 "2019-07-12T09:45:45Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
