Skip to content

Commit 4ebc93d

Browse files
committed
Add DTD docs
Signed-off-by: Andy Lo-A-Foe <andy.loafoe@gmail.com>
1 parent e5cbc12 commit 4ebc93d

6 files changed

Lines changed: 108 additions & 6 deletions
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# hsdp_cdl_data_type_definition
2+
3+
Retrieve details on HSDP Clinical Data Lake Data Type Definition.
4+
5+
## Example Usage
6+
7+
```hcl
8+
data "hsdp_cdl_data_type_definition" "def_a" {
9+
cdl_endpoint = data.cdl_instance.cicd.endpoint
10+
dtd_id = var.dtd_id
11+
}
12+
13+
output "schema" {
14+
value = data.hsdp_cdl_data_type_definition.def_a.json_schema
15+
}
16+
```
17+
18+
19+
## Argument Reference
20+
21+
The following arguments are supported:
22+
23+
* `cdl_endpoint` - (Required) The CDL instance endpoint to query
24+
* `dtd_id` - (Required) The ID of the DTD to look up
25+
26+
## Attributes Reference
27+
28+
In addition to all arguments above, the following attributes are exported:
29+
30+
* `id` - The GUID of the DTDT
31+
* `json_schema` - The JSON schema describing the DTD
32+
* `created_by` - Which entity created the DTD
33+
* `created_on` - When the DTD was created
34+
* `updated_by` - Which entity updated the DTD last
35+
* `updated_on` - When the DTD was updated
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# hsdp_cdl_data_type_definitions
2+
3+
Retrieve DTDs present in a HSDP Clinical Data Lake instance.
4+
5+
## Example Usage
6+
7+
```hcl
8+
data "hsdp_cdl_data_type_definitions" "all" {
9+
cdl_endpoint = data.cdl_instance.cicd.endpoint
10+
}
11+
12+
output "all_study_titles" {
13+
value = data.hsdp_cdl_research_studies.all.titles
14+
}
15+
```
16+
17+
## Argument Reference
18+
19+
The following arguments are supported:
20+
21+
* `cdl_endpoint` - (Required) The CDL instance endpoint to query
22+
23+
## Attributes Reference
24+
25+
In addition to all arguments above, the following attributes are exported:
26+
27+
* `ids` - The list of DTD GUIDs
28+
* `names` - The names of the DTDs. This matches up with the `ids` list
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# hsdp_cdl_data_type_definition
2+
3+
Manages HSDP Clinical Data Lake Data Type Definitions.
4+
5+
## Example Usage
6+
7+
```hcl
8+
resource "hsdp_cdl_data_type_definition" "def_a" {
9+
cdl_endpoint = data.cdl_instance.cicd.endpoint
10+
name = "my CDL schema A"
11+
12+
json_schema = <<EOF
13+
{}
14+
EOF
15+
}
16+
```
17+
18+
19+
## Argument Reference
20+
21+
The following arguments are supported:
22+
23+
* `cdl_endpoint` - (Required) The CDL instance endpoint to query
24+
* `name` - (Required) The name of the DTD
25+
* `description` - (Optional) The description of the DTD
26+
* `json_schema` - (Optional) The JSON Schema describing the DTD
27+
28+
## Attributes Reference
29+
30+
In addition to all arguments above, the following attributes are exported:
31+
32+
* `id` - The GUID of the DTDT
33+
* `created_by` - Which entity created the DTD
34+
* `created_on` - When the DTD was created
35+
* `updated_by` - Which entity updated the DTD last
36+
* `updated_on` - When the DTD was updated

hsdp/data_source_cdl_datatype_definition.go renamed to hsdp/data_source_cdl_data_type_definition.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package hsdp
33
import (
44
"context"
55
"encoding/json"
6+
67
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
78
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
89
)
@@ -44,7 +45,7 @@ func dataSourceCDLDataTypeDefinition() *schema.Resource {
4445

4546
}
4647

47-
func dataSourceCDLDataTypeDefinitionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
48+
func dataSourceCDLDataTypeDefinitionRead(_ context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
4849
config := m.(*Config)
4950

5051
var diags diag.Diagnostics

hsdp/data_source_cdl_datatype_definitions.go renamed to hsdp/data_source_cdl_data_type_definitions.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package hsdp
22

33
import (
44
"context"
5+
56
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
67
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
78
"github.com/philips-software/go-hsdp-api/cdl"
@@ -30,7 +31,7 @@ func dataSourceCDLDataTypeDefinitions() *schema.Resource {
3031

3132
}
3233

33-
func dataSourceCDLDataTypeDefinitionsRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
34+
func dataSourceCDLDataTypeDefinitionsRead(_ context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
3435
config := m.(*Config)
3536

3637
var diags diag.Diagnostics
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import (
44
"context"
55
"encoding/json"
66
"fmt"
7+
"net/http"
8+
79
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
810
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
911
"github.com/philips-software/go-hsdp-api/cdl"
10-
"net/http"
1112
)
1213

1314
func resourceCDLDataTypeDefinition() *schema.Resource {
@@ -43,14 +44,14 @@ func resourceCDLDataTypeDefinition() *schema.Resource {
4344
}
4445
}
4546

46-
func resourceCDLDataTypeDefinitionDelete(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
47+
func resourceCDLDataTypeDefinitionDelete(_ context.Context, d *schema.ResourceData, _ interface{}) diag.Diagnostics {
4748
var diags diag.Diagnostics
4849

4950
d.SetId("") // This is by design currently
5051
return diags
5152
}
5253

53-
func resourceCDLDataTypeDefinitionUpdate(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
54+
func resourceCDLDataTypeDefinitionUpdate(_ context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
5455
config := m.(*Config)
5556
var diags diag.Diagnostics
5657

@@ -127,7 +128,7 @@ func resourceCDLDataTypeDefinitionCreate(ctx context.Context, d *schema.Resource
127128
return resourceCDLDataTypeDefinitionRead(ctx, d, m)
128129
}
129130

130-
func resourceCDLDataTypeDefinitionRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
131+
func resourceCDLDataTypeDefinitionRead(_ context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
131132
config := m.(*Config)
132133

133134
var diags diag.Diagnostics

0 commit comments

Comments
 (0)