forked from litmuschaos/litmus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Litmus 3.0: Added enhancements in graphql (litmuschaos#4025)
* Added base setup for graphql and authentication protos Signed-off-by: Saranya-jena <[email protected]> * Added graphql schemas Signed-off-by: Saranya-jena <[email protected]> * Added cluster and namespace scope manifests Signed-off-by: Saranya-jena <[email protected]> * Added utilities and environment variables Signed-off-by: Saranya-jena <[email protected]> * Added logger and authentication middleware Signed-off-by: Saranya-jena <[email protected]> * Added api and mongodb handler functions for chaos experiments, experiment runs and infra Signed-off-by: Saranya-jena <[email protected]> * Added api and mongodb handler functions for chaoshub, environment, grpc and project Signed-off-by: Saranya-jena <[email protected]> * Added api and mongodb handler functions for image registry, gitopns and file handlers Signed-off-by: Saranya-jena <[email protected]> * Updated go version Signed-off-by: Saranya-jena <[email protected]> * Removed unused packages and chaoshub test suite Signed-off-by: Saranya-jena <[email protected]> --------- Signed-off-by: Saranya-jena <[email protected]>
- Loading branch information
1 parent
3b8a5b9
commit d8d4f14
Showing
107 changed files
with
54,642 additions
and
0 deletions.
There are no files selected for viewing
788 changes: 788 additions & 0 deletions
788
chaoscenter/graphql/definitions/shared/chaos_experiment.graphqls
Large diffs are not rendered by default.
Oops, something went wrong.
667 changes: 667 additions & 0 deletions
667
chaoscenter/graphql/definitions/shared/chaos_infrastructure.graphqls
Large diffs are not rendered by default.
Oops, something went wrong.
655 changes: 655 additions & 0 deletions
655
chaoscenter/graphql/definitions/shared/chaoshub.graphqls
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
interface ResourceDetails { | ||
name: String! | ||
description: String | ||
tags:[String!] | ||
} | ||
|
||
interface Audit { | ||
updatedAt: String | ||
createdAt: String | ||
updatedBy: UserDetails | ||
createdBy: UserDetails | ||
} | ||
|
||
type UserDetails { | ||
userID: String! | ||
username: String! | ||
email: String! | ||
} | ||
|
116 changes: 116 additions & 0 deletions
116
chaoscenter/graphql/definitions/shared/environment.graphqls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
|
||
enum EnvironmentType{ | ||
PROD | ||
NON_PROD | ||
} | ||
|
||
type Environment implements ResourceDetails & Audit { | ||
projectID:String! | ||
environmentID : String! | ||
name: String! | ||
description: String | ||
tags:[String!] | ||
type: EnvironmentType! | ||
createdAt: String! | ||
createdBy: UserDetails | ||
updatedBy: UserDetails | ||
updatedAt: String! | ||
isRemoved: Boolean | ||
infraIDs:[String!] | ||
} | ||
|
||
input CreateEnvironmentRequest{ | ||
environmentID : String! #check if human readable ID is required | ||
name: String! | ||
type: EnvironmentType! | ||
description: String | ||
tags:[String!] | ||
} | ||
|
||
input UpdateEnvironmentRequest{ | ||
environmentID : String! | ||
name: String | ||
description: String | ||
tags:[String] | ||
type: EnvironmentType | ||
} | ||
|
||
""" | ||
Defines filter options for infras | ||
""" | ||
input EnvironmentFilterInput { | ||
""" | ||
Name of the environment | ||
""" | ||
name: String | ||
""" | ||
ID of the environment | ||
""" | ||
description: String | ||
""" | ||
Type name of environment | ||
""" | ||
type: String | ||
""" | ||
Tags of an environment | ||
""" | ||
tags: [EnvironmentType] | ||
} | ||
enum EnvironmentSortingField { | ||
NAME | ||
TIME | ||
} | ||
|
||
""" | ||
Defines sorting options for experiment | ||
""" | ||
input EnvironmentSortInput { | ||
""" | ||
Field in which sorting will be done | ||
""" | ||
field: EnvironmentSortingField! | ||
""" | ||
Bool value indicating whether the sorting will be done in ascending order | ||
""" | ||
ascending: Boolean | ||
} | ||
|
||
|
||
input ListEnvironmentRequest{ | ||
""" | ||
Environment ID | ||
""" | ||
environmentIDs: [ID!] | ||
""" | ||
Details for fetching paginated data | ||
""" | ||
pagination: Pagination | ||
""" | ||
Details for fetching filtered data | ||
""" | ||
filter: EnvironmentFilterInput | ||
""" | ||
Details for fetching sorted data | ||
""" | ||
sort: EnvironmentSortInput | ||
} | ||
|
||
type ListEnvironmentResponse{ | ||
""" | ||
Total number of environment | ||
""" | ||
totalNoOfEnvironments: Int! | ||
environments:[Environment] | ||
} | ||
|
||
extend type Query { | ||
|
||
getEnvironment(projectID: ID!, environmentID: ID!) : Environment @authorized | ||
listEnvironments (projectID: ID!, request: ListEnvironmentRequest): ListEnvironmentResponse @authorized | ||
} | ||
|
||
extend type Mutation{ | ||
createEnvironment( projectID:ID!,request:CreateEnvironmentRequest): Environment @authorized | ||
updateEnvironment( projectID:ID!,request:UpdateEnvironmentRequest): String! @authorized | ||
deleteEnvironment(projectID:ID!,environmentID: ID!): String! @authorized | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
|
||
""" | ||
Defines the SSHKey details | ||
""" | ||
type SSHKey { | ||
""" | ||
Public SSH key authenticating into git repository | ||
""" | ||
publicKey: String! | ||
""" | ||
Private SSH key authenticating into git repository | ||
""" | ||
privateKey: String! | ||
} | ||
|
||
""" | ||
Details of setting a Git repository | ||
""" | ||
input GitConfig { | ||
""" | ||
ID of the project where GitOps is configured | ||
""" | ||
projectID: ID! | ||
""" | ||
Git branch where the chaos charts will be pushed and synced | ||
""" | ||
branch: String! | ||
""" | ||
URL of the Git repository | ||
""" | ||
repoURL: String! | ||
""" | ||
Type of authentication used: BASIC, SSH, TOKEN | ||
""" | ||
authType: AuthType! | ||
""" | ||
Token used for private repository | ||
""" | ||
token: String | ||
""" | ||
Git username | ||
""" | ||
userName: String | ||
""" | ||
Git password | ||
""" | ||
password: String | ||
""" | ||
Private SSH key authenticating into git repository | ||
""" | ||
sshPrivateKey: String | ||
} | ||
|
||
""" | ||
Response received after configuring GitOps | ||
""" | ||
type GitConfigResponse { | ||
""" | ||
Bool value indicating whether GitOps is enabled or not | ||
""" | ||
enabled: Boolean! | ||
""" | ||
ID of the project where GitOps is configured | ||
""" | ||
projectID: String! | ||
""" | ||
Git branch where the chaos charts will be pushed and synced | ||
""" | ||
branch: String | ||
""" | ||
URL of the Git repository | ||
""" | ||
repoURL: String | ||
""" | ||
Type of authentication used: BASIC, SSH, TOKEN | ||
""" | ||
authType: AuthType | ||
""" | ||
Token used for private repository | ||
""" | ||
token: String | ||
""" | ||
Git username | ||
""" | ||
userName: String | ||
""" | ||
Git password | ||
""" | ||
password: String | ||
""" | ||
Private SSH key authenticating into git repository | ||
""" | ||
sshPrivateKey: String | ||
} | ||
|
||
extend type Query { | ||
# GIT-OPS OPERATIONS | ||
""" | ||
Returns the git configuration for gitops | ||
""" | ||
getGitOpsDetails(projectID: ID!): GitConfigResponse! @authorized | ||
} | ||
|
||
extend type Mutation { | ||
# GIT-OPS OPERATIONS | ||
""" | ||
Sends workflow run request(single run workflow only) to agent on gitops notification | ||
""" | ||
# authorized directive not required | ||
gitopsNotifier(clusterInfo: InfraIdentity!, workflowID: ID!): String! | ||
|
||
""" | ||
Enables gitops settings in the project | ||
""" | ||
enableGitOps(configurations: GitConfig!): Boolean! @authorized | ||
|
||
""" | ||
Disables gitops settings in the project | ||
""" | ||
disableGitOps(projectID: String!): Boolean! @authorized | ||
|
||
""" | ||
Updates gitops settings in the project | ||
""" | ||
updateGitOps(configurations: GitConfig!): Boolean! @authorized | ||
} |
Oops, something went wrong.