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

Added "Documentation" feature #25

Merged
merged 4 commits into from
Sep 28, 2023
Merged

Conversation

mohith10
Copy link
Contributor

Description

The documentation feature helps us provide a URL for documentation of the specific topology deployed on TB.
This PR implements that feature. The following modifications have been made:

  1. Modified "provider.go": Added a mapping to "resource_documentation.go"

  2. Created "resource.documentation.go": Supports CRUD operations of the documentation resource.

  3. Modified /examples/provider/provider.tf: Added a documentation resource that assigns the provided URL to the topology.

  4. Created /examples/hw_documentation/resource.tf: resource.tf script that creates a topology and assigns the documentation URL.

  5. Added docs/resources/documentation.md: Specifying the schema of the documentation resource.

Type of Change

  • Bug Fix
  • New Feature
  • Breaking Change
  • Refactor
  • Documentation
  • Other (please describe)

Checklist

  • I have read the contributing guidelines
  • Existing issues have been referenced (where applicable)
  • I have verified this change is not present in other open pull requests
  • Functionality is documented
  • All code style checks pass
  • New code contribution is covered by automated tests
  • All new and existing tests pass

@@ -0,0 +1,24 @@
terraform {
Copy link
Contributor

@hughwphamill hughwphamill Sep 28, 2023

Choose a reason for hiding this comment

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

Why hw_documentation ? It's not specific to Hardware

Existing convention would make it examples/resources/documentation_resource/resource.tf

Copy link

Choose a reason for hiding this comment

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

This is addressed in the latest commit. Thanks


resource "dcloud_topology" "test_topology" {
name = "My Terraformed Topology"
description = "A topology created from terraform"
Copy link
Contributor

Choose a reason for hiding this comment

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

Convention on the other resource .tf files is to use these sort of values for the test topology...

resource "dcloud_topology" "test_topology" {
  name        = "Documentation Resource Test"
  description = "Testing Topology Documentation Resource Management"
  notes       = "Created via Terraform Test"
  datacenter  = "LON"
}

Copy link

Choose a reason for hiding this comment

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

Hi Hugh,

Done.

Provided the changes in the commit.
Thanks.

…anged topology values in resource.tf, changed resoruce name from documentation to test_documentation
@hughwphamill hughwphamill merged commit b7746b7 into cisco-open:main Sep 28, 2023
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.

4 participants