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
Conversation
@@ -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, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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>
Ok. |
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
Checklist (tick everything that applies)