Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Evacuate Server (evacuate Action) #931

Merged
merged 4 commits into from
Feb 14, 2017
Merged

add Evacuate Server (evacuate Action) #931

merged 4 commits into from
Feb 14, 2017

Conversation

test-1pro
Copy link
Contributor

@test-1pro test-1pro commented Feb 9, 2017

Hi, I'm taemin
I added Evacuate Server.
I did tests about this api and checked the result.

The example below.
ServerPassword password =
os.compute().servers().evacuate("1427b0a6-e6a1-496",
EvacuateOptions.create().host("compute1").onSharedStorage(false));
System.out.println(password.getPassword());

I hope you review codes I pulled.

ex)
ServerPassword password =
os.compute().servers().evacuate("1427b0a6-e6a1-496",
EvacuateOptions.create().host("compute1").onSharedStorage(false));	
		System.out.println(password.getPassword());
@auhlig
Copy link
Member

auhlig commented Feb 9, 2017

Hi @taemin77, Could you also add a test to the PR? Maybe just a short unit test. Please take a look at the other tests in the core-test module

Copy link
Contributor Author

@test-1pro test-1pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I add a test.
But I don't know exactly what this code - respondWith(JSON_SERVER_CREATE) is.
So I let it alone.
Could you help me finish this code?

@test-1pro
Copy link
Contributor Author

test-1pro commented Feb 10, 2017

All checks have failed?
Did I make any mistakes?

@auhlig
Copy link
Member

auhlig commented Feb 10, 2017

Hi @taemin77,
Thanks for the work.
The respondWith(JSON) is used for mocking the communication with the OpenStack instance.
The JSON contains the response as defined in OpenStacks API.
So you have to create the JSON accordingly in the compute resources folder

@@ -67,7 +68,7 @@ protected Service service() {

@Test
public void evacuateServer() throws Exception {
respondWith(JSON_SERVER_CREATE);
respondWith(JSON_SERVER_EVACUATE);

ServerPassword password = osv3().compute().servers().evacuate("e565cbdb-8e74-4044-ba6e-0155500b2c46", EvacuateOptions.create().host("server-test-1").onSharedStorage(false));
assertNotNull(password.getPassword());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last thing: Instead of assertNotNull(..)maybe assertEquals(password.getPassword(), "MySecretPass")

@auhlig
Copy link
Member

auhlig commented Feb 13, 2017

Besides the comment above this looks good @taemin77 👍

@auhlig auhlig added this to the 3.0.4 Release milestone Feb 14, 2017
@auhlig
Copy link
Member

auhlig commented Feb 14, 2017

Very cool. Many thanks for your woke @taemin77!

@auhlig auhlig merged commit a8e0627 into ContainX:master Feb 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants