cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
341
Views
5
Helpful
1
Replies
shkuzu
Cisco Employee

Hyperflex: Creating datastore via api

Hi,

I'm testing creating datastore api on HX.

I got the expected result other APIs like get datastore summary.

But I can't create datastore via api.

I'm using restexplorer with the datastore parameters

{

"name": "string",

"size": 100,

"id": "string",

"dataBlockSize": 0

}

I got the follwoing output as the result

{ "message": "Datastore not found", "messageId": 401 }

What is the problem?

1 ACCEPTED SOLUTION

Accepted Solutions
michzimm
Cisco Employee

Hi,

 

In order to create the datastore, I beleive you need to remove the "id" parameter from the body. So to create a new datstore called "mynewdatstore" with a size of "50G" with a blocksize of "8K" you would use the following body in your API call:

 

{

"name": "mynewdatastore,

"size": 50000000000,

"dataBlockSize": 8192

}

 

After the datstore is created, the system will return the datastore "id", which can then be used with the same API call to update (resize) the datstore. So to create datastore, leave out "id" parameter, to update datstore, you will need the "id" of an existing datastore.

 

Hope that helps!

Thanks

Mike 

View solution in original post

1 REPLY 1
michzimm
Cisco Employee

Hi,

 

In order to create the datastore, I beleive you need to remove the "id" parameter from the body. So to create a new datstore called "mynewdatstore" with a size of "50G" with a blocksize of "8K" you would use the following body in your API call:

 

{

"name": "mynewdatastore,

"size": 50000000000,

"dataBlockSize": 8192

}

 

After the datstore is created, the system will return the datastore "id", which can then be used with the same API call to update (resize) the datstore. So to create datastore, leave out "id" parameter, to update datstore, you will need the "id" of an existing datastore.

 

Hope that helps!

Thanks

Mike 

View solution in original post

Content for Community-Ad