Re: Doubt using the REST method: "/v2/resource_match"


arthur halet
 

Hi,

The resource is empty when nothing matching between your local file and the
blobstore.
Actually, you are not oblige to use resource match to send your app it's
just for don't send everything if you can already find file inside the
blobstore.

Le jeudi 6 août 2015, Juan Antonio Breña Moral <bren(a)juanantonio.info> a
écrit :

Hi,

I enabled traces.

```
set CF_TRACE=true
```

The output is empty:

```
Uploading StaticWebsiteHelloWorld...

REQUEST: [2015-08-06T14:11:31+02:00]
PUT /v2/resource_match HTTP/1.1
Host: api.MY_IP.xip.io
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: go-cli 6.12.1-56792aa / windows


[{"fn":"index.html","sha1":"b657e91776782799aa20eee057603fe03ead4004","size":122},{"fn":"output.txt","sha1":"cc81d5428688235ff1e3cff139a5369d7a817a99","size":12479}]

RESPONSE: [2015-08-06T14:11:31+02:00]
HTTP/1.1 200 OK
Content-Length: 2
Content-Type: application/json;charset=utf-8
Date: Thu, 06 Aug 2015 12:10:03 GMT
Server: nginx
X-Cf-Requestid: 30904f59-005c-4ca1-48a3-2ed46996ba45
X-Content-Type-Options: nosniff
X-Vcap-Request-Id:
8acb0876-9116-473c-6d0a-9939167ada31::69998296-3130-46d6-9f16-ada90aaa309c

[]
Uploading app files from: C:\Users\PATH\StaticWebsite_HelloWorld
Uploading 13.3K, 2 files

REQUEST: [2015-08-06T14:11:31+02:00]
PUT /v2/apps/f7ea4e1b-49a1-4b3f-8c67-eff9574b0a9e/bits?async=true HTTP/1.1
Host: api.MY_IP.xip.io
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: multipart/form-data;
boundary=3a1765597317479ad0600360e4a73537c4da9271587bff5a4d6d06089486
User-Agent: go-cli 6.12.1-56792aa / windows


[MULTIPART/FORM-DATA CONTENT HIDDEN]

Done uploading

RESPONSE: [2015-08-06T14:11:31+02:00]
HTTP/1.1 201 Created
Content-Length: 270
Content-Type: application/json;charset=utf-8
Date: Thu, 06 Aug 2015 12:10:04 GMT
Server: nginx
X-Cf-Requestid: 1653aed7-b9a7-41ca-5b50-43bd63b592d9
X-Content-Type-Options: nosniff
X-Vcap-Request-Id:
caa69d25-9159-4253-4748-fff9206b41ef::22095047-4e1c-452d-aafa-cce7968094e5

{
"metadata": {
"guid": "7ed54165-8205-4a36-946e-40a55e7636fb",
"created_at": "2015-08-06T12:10:04Z",
"url": "/v2/jobs/7ed54165-8205-4a36-946e-40a55e7636fb"
},
"entity": {
"guid": "7ed54165-8205-4a36-946e-40a55e7636fb",
"status": "queued"
}
}

```

The right format for resources is:

```

[{"fn":"index.html","sha1":"b657e91776782799aa20eee057603fe03ead4004","size":122},{"fn":"output.txt","sha1":"cc81d5428688235ff1e3cff139a5369d7a817a99","size":12479}]

```

Join {cf-dev@lists.cloudfoundry.org to automatically receive all group messages.