Midnighter / structurizr-python

A Python 3 port of Simon Brown's Structurizr diagrams-as-code architecture description tool.
https://structurizr.com/
Apache License 2.0
65 stars 16 forks source link

Implement DeploymentView #55

Closed yt-ms closed 3 years ago

yt-ms commented 3 years ago

Checklist

Is your feature related to a problem? Please describe it.

Following on from the main body of https://github.com/Midnighter/structurizr-python/issues/8 (Implement models, views and styles), we do not currently have an implementation for DeploymentView. One consequence of this is that if you load a workspace from Structurizr into Python, do some stuff to it (e.g. add more elements or update tags/properteis) and then push it back to Structurizr, you will lose any deployment views that you had created.

Describe the solution you would like.

Implement DeploymentView similarly to the other view types and uncomment those sections in the examples (with appropriate renaming of vars to be Python style).

One difficulty in implementing this (and possibly for the automated e2e tests) is that deployment views aren't available in the free licence plan.

Additional context

From big_bank.py:

    # DeploymentView liveDeploymentView = views.CreateDeploymentView(internet_banking_system, "LiveDeployment", "An example live deployment scenario for the Internet Banking System.")
    # liveDeploymentView.Environment = "Live"
    # liveDeploymentView.Add(big_bank_data_center)
    # liveDeploymentView.Add(customerMobileDevice)
    # liveDeploymentView.Add(customerComputer)
    # liveDeploymentView.Add(dataReplicationRelationship)
    # liveDeploymentView.PaperSize = PaperSize.A5_Landscape
yt-ms commented 3 years ago

I'm happy to pick this one up as now we have DeploymentNode implemented this will be pretty key for my main use of this Python API.