-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
112 additions
and
2 deletions.
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
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
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
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,11 @@ | ||
package render | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/mrusme/planor/nori/models" | ||
) | ||
|
||
func (cloud *Render) ListPipelines() ([]models.Pipeline, error) { | ||
return nil, errors.New("Unsupported") | ||
} |
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,31 @@ | ||
package render | ||
|
||
import ( | ||
"github.com/mrusme/planor/nori/models" | ||
|
||
// gorender "github.com/mrusme/go-render" | ||
) | ||
|
||
func (cloud *Render) ListInstances() ([]models.Instance, error) { | ||
var instances []models.Instance | ||
ret, err := cloud.render.ListServices() | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
for _, instance := range ret { | ||
newInstance := models.Instance{ | ||
ID: instance.ID, | ||
Name: instance.Name, | ||
|
||
Type: instance.Type, | ||
|
||
Status: instance.Deploys[0].Status, | ||
} | ||
|
||
instances = append(instances, newInstance) | ||
} | ||
|
||
return instances, nil | ||
} | ||
|
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 @@ | ||
package render | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/mrusme/planor/nori/models" | ||
) | ||
|
||
|
||
func (cloud *Render) ListLogGroups(updateStreams bool, updateEvents bool) ([]models.LogGroup, error) { | ||
return nil, errors.New("Unsupported") | ||
} | ||
|
||
func (cloud *Render) UpdateLogStreams(logGroup *models.LogGroup, updateEvents bool) (error) { | ||
return errors.New("Unsupported") | ||
} | ||
|
||
func (cloud *Render) UpdateLogEvents(logStream *models.LogStream) (error) { | ||
return errors.New("Unsupported") | ||
} | ||
|
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,41 @@ | ||
package render | ||
|
||
import ( | ||
// "context" | ||
"os" | ||
|
||
"github.com/mrusme/planor/nori/adapter" | ||
|
||
gorender "github.com/mrusme/go-render" | ||
) | ||
|
||
type Render struct { | ||
apiKey string | ||
render *gorender.RenderClient | ||
} | ||
|
||
func (cloud *Render) LoadProfile(profile *string) (error) { | ||
cloud.apiKey = os.Getenv(*profile) | ||
|
||
return nil | ||
} | ||
|
||
func (cloud *Render) LoadClients() (error) { | ||
var err error | ||
cloud.render, err = gorender.New(cloud.apiKey) | ||
|
||
return err | ||
} | ||
|
||
func (cloud *Render) GetCapabilities() ([]adapter.Capability) { | ||
var caps []adapter.Capability | ||
|
||
caps = append(caps, adapter.Capability{ | ||
ID: "instances", | ||
Name: "Services", | ||
}) | ||
|
||
return caps | ||
} | ||
|
||
|