Skip to content

Commit

Permalink
Merge pull request #207 from CBIIT/os_snapshot
Browse files Browse the repository at this point in the history
Os snapshot
  • Loading branch information
michael-fleming authored Aug 12, 2024
2 parents 971810a + 12007fe commit e5e8fc4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,22 @@ def registerRepo(argList, awsauth):


def createSnapshot(argList, awsauth):
# Create Index list to exclude hidden (default) indices
if argList['indices']:
print("setting backup to use listed indices")
indices = '-.*,' + argList['indices']
else:
print("setting backup to use all indices")
indices = '*,-.*'

# Create Snapshot
snapshot_url = argList['oshost'] + '_snapshot/' + argList['repo'] + '/' + argList['snapshot'] + '/'
print(snapshot_url)

headers = {"Content-Type": "application/json"}
payload = {
"indices": argList['indices'],
"indices": indices,
"include_global_state": False
}

print("taking opensearch snapshot")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,18 @@ def restoreIndexes(argList, awsauth):
# Restoring Indexes
print("started restore the indices")

# Create Index list to exclude hidden (default) indices
if argList['indices']:
print("setting restore to use listed indices")
indices = '-.*,' + argList['indices']
else:
print("setting restore to use all indices")
indices = '*,-.*'

headers = {"Content-Type": "application/json"}

payload = {
"indices": argList['indices'],
"indices": indices,
"include_global_state": False,
}
path = '_snapshot/' + argList['repo'] + '/' + argList['snapshot'] + '/_restore'
Expand Down
8 changes: 4 additions & 4 deletions terraform/modules/secrets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

| Name | Version |
|------|---------|
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | 4.66.1 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >=4.66.1 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.66.1 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | >=4.66.1 |

## Modules

Expand All @@ -19,8 +19,8 @@ No modules.

| Name | Type |
|------|------|
| [aws_secretsmanager_secret.secrets](https://registry.terraform.io/providers/hashicorp/aws/4.66.1/docs/resources/secretsmanager_secret) | resource |
| [aws_secretsmanager_secret_version.secrets_value](https://registry.terraform.io/providers/hashicorp/aws/4.66.1/docs/resources/secretsmanager_secret_version) | resource |
| [aws_secretsmanager_secret.secrets](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/secretsmanager_secret) | resource |
| [aws_secretsmanager_secret_version.secrets_value](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/secretsmanager_secret_version) | resource |

## Inputs

Expand Down

0 comments on commit e5e8fc4

Please sign in to comment.