コード例 #1
0
ファイル: resource.go プロジェクト: OSBI/juju
func (r resources) registerHookContextFacade() {
	common.RegisterHookContextFacade(
		context.HookContextFacade,
		internalserver.FacadeVersion,
		r.newHookContextFacade,
		reflect.TypeOf(&internalserver.UnitFacade{}),
	)
	api.RegisterFacadeVersion(context.HookContextFacade, internalserver.FacadeVersion)
}
コード例 #2
0
func (c payloads) registerHookContextFacade() {
	const version = 0
	common.RegisterHookContextFacade(
		payloadsHookContextFacade,
		version,
		c.newHookContextFacade,
		reflect.TypeOf(&internalserver.UnitFacade{}),
	)
	api.RegisterFacadeVersion(payloadsHookContextFacade, version)
}
コード例 #3
0
ファイル: resource.go プロジェクト: OSBI/juju
// registerPublicFacade adds the resources public API facade
// to the API server.
func (r resources) registerPublicFacade() {
	if !markRegistered(resource.ComponentName, "public-facade") {
		return
	}

	common.RegisterStandardFacade(
		resource.ComponentName,
		server.Version,
		r.newPublicFacade,
	)
	api.RegisterFacadeVersion(resource.ComponentName, server.Version)
}
コード例 #4
0
func (c payloads) registerPublicFacade() {
	if !markRegistered(payload.ComponentName, "public-facade") {
		return
	}

	const version = 1
	common.RegisterStandardFacade(
		payload.ComponentName,
		version,
		c.newPublicFacade,
	)
	api.RegisterFacadeVersion(payload.ComponentName, version)
}
コード例 #5
0
ファイル: resource.go プロジェクト: AlexisBruemmer/juju
func (r resources) registerHookContextFacade() {
	common.RegisterHookContextFacade(
		context.HookContextFacade,
		internalserver.FacadeVersion,
		r.newHookContextFacade,
		reflect.TypeOf(&internalserver.UnitFacade{}),
	)
	coreapi.RegisterFacadeVersion(context.HookContextFacade, internalserver.FacadeVersion)

	common.RegisterAPIModelEndpoint(internalapi.HTTPEndpointPattern, apihttp.HandlerSpec{
		Constraints: apihttp.HandlerConstraints{
			AuthKind:            names.UnitTagKind,
			StrictValidation:    true,
			ControllerModelOnly: false,
		},
		NewHandler: resourceadapters.NewDownloadHandler,
	})
}
コード例 #6
0
ファイル: resource.go プロジェクト: AlexisBruemmer/juju
// registerPublicFacade adds the resources public API facade
// to the API server.
func (r resources) registerPublicFacade() {
	if !markRegistered(resource.ComponentName, "public-facade") {
		return
	}

	common.RegisterStandardFacade(
		resource.ComponentName,
		server.Version,
		resourceadapters.NewPublicFacade,
	)
	coreapi.RegisterFacadeVersion(resource.ComponentName, server.Version)

	common.RegisterAPIModelEndpoint(api.HTTPEndpointPattern, apihttp.HandlerSpec{
		Constraints: apihttp.HandlerConstraints{
			AuthKind:            names.UserTagKind,
			StrictValidation:    true,
			ControllerModelOnly: false,
		},
		NewHandler: resourceadapters.NewUploadHandler,
	})
}