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

Refactor DimensionData Create node to support MCP2 and backward compatible with MCP1 #902

Merged
merged 4 commits into from Oct 24, 2016

Conversation

samuelchong
Copy link
Contributor

Changes Title (replace this with a logical title for your changes)

Description

Refactor create_node for MCP2 to support CaaS API 2.3 feature. You could now specify Network Adapter Name for primary and additional NIC. Parameters in create_node function is tailored for MCP2.

However, this function also allow backward compatibility for MCP1 using kwargs. Code snippet provided in documentation on creating node for MCP1 and MCP2.

Status

  • done, ready for review

Checklist (tick everything that applies)

  • Code linting (required, can be done after the PR checks)
  • Documentation
  • Tests
  • ICLA (required for bigger changes)

@@ -732,7 +732,8 @@ class DimensionDataServerDisk(object):
"""
A class that represents the disk on a server
"""
def __init__(self, id, scsi_id, size_gb, speed, state):
def __init__(self, id=None, scsi_id=None, size_gb=None, speed=None,
Copy link
Contributor

Choose a reason for hiding this comment

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

id should not be optional. I would also argue that none of the other variables should be either?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Request for deploy server CaaS API https:///caas/2.3/{org-id}/server/deployServer is requiring scsi_id and speed only.

That's why I make them optional so that I could use this data class for deploy server.

<deployServer xmlns="urn:didata.com:api:cloud:types"> 
      <name>Production FTPS Server</name>
      <description>This is the main FTPS Server</description> 
      <imageId>e0b48a16-f5c3-4045-bfd0-a1a7232a2710</imageId> 
      <start>true</start>      
      <administratorPassword>P$$ssWwrrdGoDd!</administratorPassword> 
      <cpu speed="HIGHPERFORMANCE" count="4" coresPerSocket="2"/>      
      <memoryGb>4</memoryGb>
      <network> <networkId>c550be0e-65c1-11e4-811f-005056806999</networkId>
      </network> 
      <primaryDns>10.20.255.12</primaryDns>    
      <secondaryDns>10.20.255.13</secondaryDns> 
      <disk scsiId="0" speed="STANDARD"/>
      <microsoftTimeZone>040</microsoftTimeZone>
</deployServer>

@tonybaloney
Copy link
Contributor

Ok. 👍

@asfgit asfgit merged commit fc9c396 into apache:trunk Oct 24, 2016
asfgit pushed a commit that referenced this pull request Oct 24, 2016
asfgit pushed a commit that referenced this pull request Oct 24, 2016
@samuelchong samuelchong deleted the create_node_mcp2 branch October 25, 2016 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants