Project

Profile

Help

Story #3473

closed

As a plugin writer, I have documentation on how to create live api endpoints responsibly

Added by daviddavis over 6 years ago. Updated about 4 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
No
Tags:
Documentation
Sprint:
Quarter:

Description

Working on the Ansible plugin, I need to define a live api that can serve up Galaxy metadata. I'm imagining for roles for example, this might live at "/api/v3/roles/" but I have some concerns obviously. Namely, is my url going to conflict with other plugins or pulpcore? Also what docs do I look at to know how to add these urls?

Add a new page called 'Adding Views' as a top-level section of the Plugin Writer's Guide . This documentation must:

1. Document how to define a url endpoint that Pulp core will serve
2. Document and advise plugin writers to namespace their Live API routes whenever possible to:

v3/plugins/<plugin_type>/something/

Related issues

Related to Pulp - Story #3560: As a plugin writer, I can write views (at arbirary endpoints) which are discovered and registered with pulpcore.CLOSED - CURRENTRELEASEamacdona@redhat.com

Actions
Actions #1

Updated by daviddavis over 6 years ago

  • Tags Pulp 3, Pulp 3 MVP added
Actions #2

Updated by daviddavis over 6 years ago

  • Subject changed from No way to create api endpoints and be sure that they don't conflict with other plugins to No way to create api endpoints and be sure that they don't conflict with other plugins and pulpcore
Actions #3

Updated by daviddavis over 6 years ago

  • Description updated (diff)
Actions #4

Updated by dalley over 6 years ago

  • Tracker changed from Issue to Story
  • % Done set to 0
Actions #5

Updated by daviddavis over 6 years ago

  • Subject changed from No way to create api endpoints and be sure that they don't conflict with other plugins and pulpcore to As a plugin writer, I have a way to create api endpoints and know they don't conflict with other plugins and pulpcore
Actions #6

Updated by bmbouter over 6 years ago

Yes we need a way to have a plugin provide a view at a URL like /mytoplevelview/ This comes from the live API MVP requirements since some content APIs have hard-coded expectations. This may make some plugins incompatible but that's because their live APIs fundamentally are. I can't give an example because the idea of colliding viewsets is still a theoretical problem.

I'm +1 on option 2. I think it would be good for core to document a recommended a convention whereby plugin views are namespaced by plugin name.

I do not think we need a way to enforce or guarantee that plugin views won't collide.

Actions #7

Updated by amacdona@redhat.com over 6 years ago

I think it would be nice to prevent collisions, but for the time being Option 2 seems good.

In addition to "encouraging namespacing" we could encourage a specific convention.

Actions #8

Updated by daviddavis over 6 years ago

@asmacdo, +1. What about for a convention we use /api/v3/plugin/<plugin name>/.../? So like /api/v3/plugin/ansible/something/.

Actions #9

Updated by daviddavis over 6 years ago

  • Related to Story #3181: As a user, I have a roles API for published distribution base paths added
Actions #10

Updated by daviddavis over 6 years ago

  • Related to deleted (Story #3181: As a user, I have a roles API for published distribution base paths)
Actions #11

Updated by daviddavis over 6 years ago

  • Blocks Story #3181: As a user, I have a roles API for published distribution base paths added
Actions #12

Updated by amacdona@redhat.com over 6 years ago

  • Description updated (diff)
Actions #13

Updated by bmbouter over 6 years ago

I like the story as it's written.

Which page in the docs is this going on? I couldn't find a section on "adding Live APIs". If not we should add one along w/ this ticket. Or maybe another docs piece of work is adding something like that?

Also another idea: since /api/v3/ is kind of popular maybe the Pulp prefix should be be /pulpapi/v3/ instead?

Actions #14

Updated by bmbouter over 6 years ago

I moved the renaming idea to its own issue: https://pulp.plan.io/issues/3532

Actions #15

Updated by daviddavis over 6 years ago

I'm imagining that the scope of this is much larger than just Live APIs so I think it would be best to either add this to the plugins/plugin-writer/basics.rst under an "API routes" section or maybe add a completely new page about how to define new routes/views in plugins.

Actions #16

Updated by bmbouter over 6 years ago

I think a topic this important would benefit from its own page.

Actions #17

Updated by bmbouter over 6 years ago

  • Subject changed from As a plugin writer, I have a way to create api endpoints and know they don't conflict with other plugins and pulpcore to As a plugin writer, I have documentation on how to create api endpoints responsibly
  • Description updated (diff)

Rewriting to call out a bit more documentation needed with the ticket.

Actions #18

Updated by amacdona@redhat.com over 6 years ago

  • Groomed changed from No to Yes
  • Sprint Candidate changed from No to Yes
Actions #19

Updated by daviddavis over 6 years ago

  • Subject changed from As a plugin writer, I have documentation on how to create api endpoints responsibly to As a plugin writer, I have documentation on how to create live api endpoints responsibly
  • Sprint set to Sprint 35
  • Tags Documentation added
Actions #20

Updated by amacdona@redhat.com over 6 years ago

  • Related to Story #3560: As a plugin writer, I can write views (at arbirary endpoints) which are discovered and registered with pulpcore. added
Actions #21

Updated by amacdona@redhat.com over 6 years ago

  • Blocks deleted (Story #3181: As a user, I have a roles API for published distribution base paths)
Actions #22

Updated by amacdona@redhat.com over 6 years ago

  • Blocks Story #3181: As a user, I have a roles API for published distribution base paths added
Actions #23

Updated by dkliban@redhat.com over 6 years ago

  • Sprint/Milestone set to 3.0.0
Actions #24

Updated by rchan over 6 years ago

  • Sprint changed from Sprint 35 to Sprint 36
Actions #25

Updated by rchan over 6 years ago

  • Sprint changed from Sprint 36 to Sprint 37
Actions #26

Updated by rchan over 6 years ago

  • Sprint changed from Sprint 37 to Sprint 38
Actions #27

Updated by amacdona@redhat.com over 6 years ago

  • Project changed from Pulp to 27
  • Sprint/Milestone deleted (3.0.0)
Actions #28

Updated by rchan over 6 years ago

  • Sprint changed from Sprint 38 to Sprint 39
Actions #29

Updated by amacdona@redhat.com over 6 years ago

My current plan is not to include live-api docs in the main plugin writer walkthrough, instead to include it in a reference section, which will be be linked to at the end of the walkthrough as "next steps" or "advanced".

Please open a PR to a feature branch for plugin-writer docs:
https://github.com/asmacdo/plugin_template/tree/add-plugin-writer-docs

The change should go here:
https://github.com/asmacdo/plugin_template/blob/add-plugin-writer-docs/docs/plugin-writer/reference/live-api.rst

Note, please review whats already there. I'm not sure its correct to say that this is primarily a publishing thing.

Actions #30

Updated by dkliban@redhat.com over 6 years ago

  • Sprint changed from Sprint 39 to Sprint 40
Actions #31

Updated by rchan over 6 years ago

  • Sprint changed from Sprint 40 to Sprint 41
Actions #32

Updated by rchan about 6 years ago

  • Sprint changed from Sprint 41 to Sprint 42
Actions #33

Updated by rchan about 6 years ago

  • Sprint changed from Sprint 42 to Sprint 43
Actions #34

Updated by bmbouter about 6 years ago

  • Blocks deleted (Story #3181: As a user, I have a roles API for published distribution base paths)
Actions #35

Updated by amacdona@redhat.com about 6 years ago

  • Sprint changed from Sprint 43 to Sprint 44
Actions #36

Updated by daviddavis about 6 years ago

  • Sprint changed from Sprint 44 to Sprint 45
Actions #37

Updated by rchan almost 6 years ago

  • Sprint changed from Sprint 45 to Sprint 46
Actions #38

Updated by rchan almost 6 years ago

  • Sprint changed from Sprint 46 to Sprint 47
Actions #39

Updated by rchan almost 6 years ago

  • Sprint changed from Sprint 47 to Sprint 48
Actions #40

Updated by ipanova@redhat.com over 5 years ago

  • Sprint deleted (Sprint 48)
Actions #41

Updated by dkliban@redhat.com over 5 years ago

  • Project changed from 27 to Pulp
  • Tags deleted (Pulp 3 MVP)

This should be part of the docs in pulpcore-plugin repo.

Actions #42

Updated by ipanova@redhat.com over 5 years ago

  • Sprint Candidate changed from Yes to No
Actions #43

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3)
Actions #44

Updated by daviddavis about 4 years ago

  • Status changed from NEW to CLOSED - WONTFIX

Also available in: Atom PDF