Skip to content

Commit

Permalink
Add endpoint resource (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-mazurkiewicz authored Apr 10, 2024
1 parent ace99e5 commit 03248d6
Show file tree
Hide file tree
Showing 19 changed files with 1,722 additions and 9 deletions.
55 changes: 55 additions & 0 deletions docs/data-sources/endpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ise_endpoint Data Source - terraform-provider-ise"
subcategory: "Identity Management"
description: |-
This data source can read the Endpoint.
---

# ise_endpoint (Data Source)

This data source can read the Endpoint.

## Example Usage

```terraform
data "ise_endpoint" "example" {
id = "76d24097-41c4-4558-a4d0-a8c07ac08470"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `id` (String) The id of the object
- `name` (String) The name of the endpoint

### Read-Only

- `custom_attributes` (Map of String) Custom Attributes
- `description` (String) Description
- `group_id` (String) Identity Group ID
- `identity_store` (String) Identity Store
- `identity_store_id` (String) Identity Store Id
- `mac` (String) MAC address of the endpoint
- `mdm_compliance_status` (Boolean) Mdm Compliance Status
- `mdm_encrypted` (Boolean) Mdm Encrypted
- `mdm_enrolled` (Boolean) Mdm Enrolled
- `mdm_imei` (String) Mdm IMEI
- `mdm_jail_broken` (Boolean) Mdm JailBroken
- `mdm_manufacturer` (String) Mdm Manufacturer
- `mdm_model` (String) Mdm Model
- `mdm_os` (String) Mdm OS
- `mdm_phone_number` (String) Mdm PhoneNumber
- `mdm_pinlock` (Boolean) Mdm Pinlock
- `mdm_reachable` (Boolean) Mdm Reachable
- `mdm_serial` (String) Mdm Serial
- `mdm_server_name` (String) Mdm Server Name
- `portal_user` (String) Portal User
- `profile_id` (String) Profile ID
- `static_group_assignment` (Boolean) Static Group Assignment
- `static_group_assignment_defined` (Boolean) staticGroupAssignmentDefined
- `static_profile_assignment` (Boolean) Static Profile Assignment
- `static_profile_assignment_defined` (Boolean) Static Profile Assignment Defined
76 changes: 76 additions & 0 deletions docs/resources/endpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "ise_endpoint Resource - terraform-provider-ise"
subcategory: "Identity Management"
description: |-
This resource can manage an Endpoint.
---

# ise_endpoint (Resource)

This resource can manage an Endpoint.

## Example Usage

```terraform
resource "ise_endpoint" "example" {
name = "00:11:22:33:44:55"
description = "My endpoint"
mac = "00:11:22:33:44:55"
group_id = "3a88eec0-8c00-11e6-996c-525400b48521"
profile_id = "3a91a150-8c00-11e6-996c-525400b48521"
static_profile_assignment = true
static_profile_assignment_defined = true
static_group_assignment = true
static_group_assignment_defined = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `group_id` (String) Identity Group ID
- `mac` (String) MAC address of the endpoint
- `name` (String) The name of the endpoint
- `static_group_assignment` (Boolean) Static Group Assignment
- `static_profile_assignment` (Boolean) Static Profile Assignment

### Optional

- `custom_attributes` (Map of String) Custom Attributes
- `description` (String) Description
- `identity_store` (String) Identity Store
- `identity_store_id` (String) Identity Store Id
- `mdm_compliance_status` (Boolean) Mdm Compliance Status
- `mdm_encrypted` (Boolean) Mdm Encrypted
- `mdm_enrolled` (Boolean) Mdm Enrolled
- `mdm_imei` (String) Mdm IMEI
- `mdm_jail_broken` (Boolean) Mdm JailBroken
- `mdm_manufacturer` (String) Mdm Manufacturer
- `mdm_model` (String) Mdm Model
- `mdm_os` (String) Mdm OS
- `mdm_phone_number` (String) Mdm PhoneNumber
- `mdm_pinlock` (Boolean) Mdm Pinlock
- `mdm_reachable` (Boolean) Mdm Reachable
- `mdm_serial` (String) Mdm Serial
- `mdm_server_name` (String) Mdm Server Name
- `portal_user` (String) Portal User
- `profile_id` (String) Profile ID
- `static_group_assignment_defined` (Boolean) staticGroupAssignmentDefined
- Default value: `true`
- `static_profile_assignment_defined` (Boolean) Static Profile Assignment Defined
- Default value: `true`

### Read-Only

- `id` (String) The id of the object

## Import

Import is supported using the following syntax:

```shell
terraform import ise_endpoint.example "76d24097-41c4-4558-a4d0-a8c07ac08470"
```
3 changes: 3 additions & 0 deletions examples/data-sources/ise_endpoint/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "ise_endpoint" "example" {
id = "76d24097-41c4-4558-a4d0-a8c07ac08470"
}
1 change: 1 addition & 0 deletions examples/resources/ise_endpoint/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import ise_endpoint.example "76d24097-41c4-4558-a4d0-a8c07ac08470"
11 changes: 11 additions & 0 deletions examples/resources/ise_endpoint/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "ise_endpoint" "example" {
name = "00:11:22:33:44:55"
description = "My endpoint"
mac = "00:11:22:33:44:55"
group_id = "3a88eec0-8c00-11e6-996c-525400b48521"
profile_id = "3a91a150-8c00-11e6-996c-525400b48521"
static_profile_assignment = true
static_profile_assignment_defined = true
static_group_assignment = true
static_group_assignment_defined = true
}
153 changes: 153 additions & 0 deletions gen/definitions/endpoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
---
name: Endpoint
rest_endpoint: /ers/config/endpoint
data_source_name_query: true
doc_category: Identity Management
attributes:
- model_name: name
data_path: [ERSEndPoint]
type: String
mandatory: true
description: The name of the endpoint
example: 00:11:22:33:44:55
- model_name: description
data_path: [ERSEndPoint]
type: String
description: Description
example: My endpoint
- model_name: mac
data_path: [ERSEndPoint]
type: String
mandatory: true
description: MAC address of the endpoint
example: 00:11:22:33:44:55
- model_name: groupId
data_path: [ERSEndPoint]
mandatory: true
type: String
description: Identity Group ID
example: 3a88eec0-8c00-11e6-996c-525400b48521
test_value: ise_endpoint_identity_group.test.id
- model_name: profileId
data_path: [ERSEndPoint]
type: String
description: Profile ID
example: 3a91a150-8c00-11e6-996c-525400b48521
- model_name: staticProfileAssignment
data_path: [ERSEndPoint]
mandatory: true
type: Bool
description: Static Profile Assignment
example: true
- model_name: staticProfileAssignmentDefined
data_path: [ERSEndPoint]
type: Bool
description: Static Profile Assignment Defined
default_value: true
example: true
- model_name: staticGroupAssignment
data_path: [ERSEndPoint]
mandatory: true
type: Bool
description: Static Group Assignment
example: true
- model_name: staticGroupAssignmentDefined
data_path: [ERSEndPoint]
type: Bool
description: staticGroupAssignmentDefined
default_value: true
example: true
- model_name: customAttributes
data_path: [ERSEndPoint, customAttributes]
type: Map
description: Custom Attributes
exclude_test: true
example: "{\"key1\" = \"value1\"}"
- model_name: identityStore
data_path: [ERSEndPoint]
type: String
description: Identity Store
exclude_test: true
- model_name: identityStoreId
data_path: [ERSEndPoint]
type: String
description: Identity Store Id
exclude_test: true
- model_name: portalUser
data_path: [ERSEndPoint]
type: String
description: Portal User
exclude_test: true
- model_name: mdmServerName
data_path: [ERSEndPoint, mdmAttributes]
type: String
description: Mdm Server Name
exclude_test: true
- model_name: mdmReachable
data_path: [ERSEndPoint, mdmAttributes]
type: Bool
description: Mdm Reachable
exclude_test: true
- model_name: mdmEnrolled
data_path: [ERSEndPoint, mdmAttributes]
type: Bool
description: Mdm Enrolled
exclude_test: true
- model_name: mdmComplianceStatus
data_path: [ERSEndPoint, mdmAttributes]
type: Bool
description: Mdm Compliance Status
exclude_test: true
- model_name: mdmOS
tf_name: mdm_os
data_path: [ERSEndPoint, mdmAttributes]
type: String
description: Mdm OS
exclude_test: true
- model_name: mdmManufacturer
data_path: [ERSEndPoint, mdmAttributes]
type: String
description: Mdm Manufacturer
exclude_test: true
- model_name: mdmModel
data_path: [ERSEndPoint, mdmAttributes]
type: String
description: Mdm Model
exclude_test: true
- model_name: mdmSerial
data_path: [ERSEndPoint, mdmAttributes]
type: String
description: Mdm Serial
exclude_test: true
- model_name: mdmEncrypted
data_path: [ERSEndPoint, mdmAttributes]
type: Bool
description: Mdm Encrypted
exclude_test: true
- model_name: mdmPinlock
data_path: [ERSEndPoint, mdmAttributes]
type: Bool
description: Mdm Pinlock
exclude_test: true
- model_name: mdmJailBroken
data_path: [ERSEndPoint, mdmAttributes]
type: Bool
description: Mdm JailBroken
exclude_test: true
- model_name: mdmIMEI
tf_name: mdm_imei
data_path: [ERSEndPoint, mdmAttributes]
type: String
description: Mdm IMEI
exclude_test: true
- model_name: mdmPhoneNumber
data_path: [ERSEndPoint, mdmAttributes]
type: String
description: Mdm PhoneNumber
exclude_test: true
test_prerequisites: |
resource "ise_endpoint_identity_group" "test" {
name = "EndpointGroup1"
description = "Test endpoint identity group"
system_defined = false
}
2 changes: 1 addition & 1 deletion gen/schema/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ attribute:
model_name: str(required=False) # Name of the attribute in the model (payload)
requires_replace: bool(required=False) # Set to true if the attribute requires a replace operation
tf_name: str(required=False) # Name of the attribute in the Terraform resource, by default derived from model_name
type: enum('String', 'Int64', 'Float', 'Bool', 'List', 'Set', required=False) # Type of the attribute
type: enum('String', 'Int64', 'Float', 'Bool', 'List', 'Set', 'Map', required=False) # Type of the attribute
element_type: enum('String', 'Int64', required=False) # only relevant if type is either 'List' or 'Set'
data_path: list(str(), required=False) # Path to the attribute in the model structure
id: bool(required=False) # Set to true if the attribute is part of the ID
Expand Down
6 changes: 6 additions & 0 deletions gen/templates/data_source.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions gen/templates/data_source_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 03248d6

Please sign in to comment.