This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from secondsun/mdc2ups
chore:replace mdc with ups
- Loading branch information
Showing
6 changed files
with
103 additions
and
102 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 was deleted.
Oops, something went wrong.
This file was deleted.
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,50 @@ | ||
package unifiedpush | ||
|
||
import ( | ||
"net/http" | ||
"os" | ||
|
||
brokerapi "github.com/integr8ly/managed-service-broker/pkg/broker" | ||
glog "github.com/sirupsen/logrus" | ||
) | ||
|
||
type UnifiedpushDeployer struct { | ||
id string | ||
} | ||
|
||
func NewDeployer() *UnifiedpushDeployer { | ||
return &UnifiedpushDeployer{} | ||
} | ||
|
||
func (md *UnifiedpushDeployer) GetCatalogEntries() []*brokerapi.Service { | ||
glog.Infof("Getting unifiedpush catalog entries") | ||
return getCatalogServicesObj() | ||
} | ||
|
||
func (md *UnifiedpushDeployer) GetID() string { | ||
return md.id | ||
} | ||
|
||
func (md *UnifiedpushDeployer) Deploy(req *brokerapi.ProvisionRequest, async bool) (*brokerapi.ProvisionResponse, error) { | ||
glog.Infof("Deploying unifiedpush from deployer, id: %s", req.InstanceId) | ||
|
||
dashboardUrl := os.Getenv("UNIFIEDPUSH_DASHBOARD_URL") | ||
|
||
return &brokerapi.ProvisionResponse{ | ||
Code: http.StatusAccepted, | ||
DashboardURL: dashboardUrl, | ||
}, nil | ||
} | ||
|
||
func (md *UnifiedpushDeployer) RemoveDeploy(req *brokerapi.DeprovisionRequest, async bool) (*brokerapi.DeprovisionResponse, error) { | ||
return &brokerapi.DeprovisionResponse{Operation: "remove"}, nil | ||
} | ||
|
||
func (ac *UnifiedpushDeployer) ServiceInstanceLastOperation(req *brokerapi.LastOperationRequest) (*brokerapi.LastOperationResponse, error) { | ||
glog.Infof("Getting last operation for %s", req.InstanceId) | ||
|
||
return &brokerapi.LastOperationResponse{ | ||
State: brokerapi.StateSucceeded, | ||
Description: "unifiedpush deployed successfully", | ||
}, nil | ||
} |
Oops, something went wrong.