@@ -4,30 +4,29 @@ import (
44 "context"
55 "fmt"
66
7- "github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go/peer"
87 "github.com/threefoldtech/zos/pkg/gridtypes"
98)
109
11- func (a * Api ) DeploymentDeployHandler (ctx context.Context , deployment gridtypes.Deployment ) error {
12- return a .provisionStub .CreateOrUpdate (ctx , peer . GetTwinID ( ctx ) , deployment , false )
10+ func (a * Api ) DeploymentDeployHandler (ctx context.Context , twinId uint32 , deployment gridtypes.Deployment ) error {
11+ return a .provisionStub .CreateOrUpdate (ctx , twinId , deployment , false )
1312}
1413
15- func (g * Api ) DeploymentUpdateHandler (ctx context.Context , deployment gridtypes.Deployment ) error {
16- return g .provisionStub .CreateOrUpdate (ctx , peer . GetTwinID ( ctx ) , deployment , true )
14+ func (g * Api ) DeploymentUpdateHandler (ctx context.Context , twinId uint32 , deployment gridtypes.Deployment ) error {
15+ return g .provisionStub .CreateOrUpdate (ctx , twinId , deployment , true )
1716}
1817
1918func (g * Api ) DeploymentDeleteHandler (ctx context.Context ) error {
2019 return fmt .Errorf ("deletion over the Api is disabled, please cancel your contract instead" )
2120}
2221
23- func (g * Api ) DeploymentGetHandler (ctx context.Context , contractId uint64 ) (gridtypes.Deployment , error ) {
24- return g .provisionStub .Get (ctx , peer . GetTwinID ( ctx ) , contractId )
22+ func (g * Api ) DeploymentGetHandler (ctx context.Context , twinId uint32 , contractId uint64 ) (gridtypes.Deployment , error ) {
23+ return g .provisionStub .Get (ctx , twinId , contractId )
2524}
2625
27- func (g * Api ) DeploymentListHandler (ctx context.Context ) ([]gridtypes.Deployment , error ) {
28- return g .provisionStub .List (ctx , peer . GetTwinID ( ctx ) )
26+ func (g * Api ) DeploymentListHandler (ctx context.Context , twinId uint32 ) ([]gridtypes.Deployment , error ) {
27+ return g .provisionStub .List (ctx , twinId )
2928}
3029
31- func (g * Api ) DeploymentChangesHandler (ctx context.Context , contractId uint64 ) ([]gridtypes.Workload , error ) {
32- return g .provisionStub .Changes (ctx , peer . GetTwinID ( ctx ) , contractId )
30+ func (g * Api ) DeploymentChangesHandler (ctx context.Context , twinId uint32 , contractId uint64 ) ([]gridtypes.Workload , error ) {
31+ return g .provisionStub .Changes (ctx , twinId , contractId )
3332}
0 commit comments