-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: richardli1598 <[email protected]>
- Loading branch information
richardli1598
committed
Aug 20, 2023
1 parent
6fbfe61
commit 17103d1
Showing
4 changed files
with
128 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1,49 @@ | ||
# nasone | ||
NAS External Service Unified Configuration Center | ||
|
||
Take you to the land of light, the city of freedom(A unified external service management system for NAS). | ||
|
||
# demo | ||
|
||
action element demo: | ||
```yaml | ||
kind: action | ||
name: remoteInstallNginx | ||
description: xxx | ||
parameter: | ||
ip: x1 | ||
sshUser: x2 | ||
sshPasword: x3 | ||
os: ubuntu | ||
image: xxxx | ||
``` | ||
full workflow demo: | ||
```yaml | ||
name: exposeLocalService | ||
kind: workflow | ||
on: dispatch #dispatch/period/trigger | ||
- use: action/nginxInstall | ||
with: | ||
ip: 192.168.1.6 | ||
sshUser: root | ||
sshPassword: root | ||
os: ubuntu | ||
- use: action/frpServerInstall | ||
with: | ||
ip: 192.168.1.6 | ||
sshUser: root | ||
sshPassword: root | ||
os: ubuntu | ||
- use: action/frpClientInstall | ||
with: | ||
ip: 192.168.1.2 | ||
sshUser: root | ||
sshPassword: root | ||
os: ubuntu | ||
- use: action/exportLocalService | ||
with: | ||
localPort: 45 | ||
remotePort: 80 | ||
dns: video.opennaslab.com | ||
``` |
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,21 @@ | ||
/* | ||
Copyright 2023 The opennaslab Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicabl e law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package main | ||
|
||
func main() { | ||
|
||
} |
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,3 @@ | ||
module opennaslab.io/bifrost | ||
|
||
go 1.20 |
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,56 @@ | ||
/* | ||
Copyright 2023 The opennaslab Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicabl e law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package api | ||
|
||
type Action struct { | ||
Kind string `json:"kind"` | ||
Name string `json:"name"` | ||
Description string `json:"description"` | ||
Parameters map[string]string `json:"parameters,omitempty"` | ||
Image string `json:"image"` | ||
} | ||
|
||
type WorkflowType string | ||
|
||
const ( | ||
DispatchWorklow WorkflowType = "dispatch" | ||
PeriodicWorkflow WorkflowType = "periodic" | ||
// MixedWorkflow means both dispatch and periodic | ||
MixedWorkflow WorkflowType = "mixed" | ||
) | ||
|
||
type Workflow struct { | ||
Kind string `json:"kind"` | ||
Name string `json:"name"` | ||
On WorkflowType `json:"on"` | ||
// +optional | ||
Schedule string `json:"schedule,omitempty"` | ||
Actions []WorkflowActionElement `json:"actions"` | ||
Status WorkflowStatus `json:"status,omitempty"` | ||
} | ||
|
||
type WorkflowActionElement struct { | ||
Use string `json:"use"` | ||
With map[string]string `json:"with"` | ||
} | ||
|
||
type WorkflowStatus struct { | ||
NextExecutionTime string `json:"nextExecutionTime"` | ||
Finished bool `json:"finished"` | ||
StepIndex int32 `json:"stepIndex"` | ||
Message string `json:"message"` | ||
} |