cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
689
Views
5
Helpful
1
Replies

Hyperflex: Creating datastore via api

shkuzu
Cisco Employee
Cisco Employee

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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card