~cjwatson/launchpad/explicit-proxy-mirror-prober

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/stories/webservice/xx-person-createppa.txt

  • Committer: Colin Watson
  • Date: 2018-07-02 11:28:52 UTC
  • mfrom: (18701.1.10 devel)
  • Revision ID: cjwatson@canonical.com-20180702112852-ec58lmwxmf61w213
Merge devel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
  >>> ppa_owner_webservice = webservice_for_person(
18
18
  ...     owner, permission=OAuthPermission.WRITE_PRIVATE)
19
19
 
20
 
  >>> print ppa_owner_webservice.named_post(
 
20
  >>> print(ppa_owner_webservice.named_post(
21
21
  ...     ppa_owner['self_link'], 'createPPA', {}, distribution='/ubuntu',
22
 
  ...     name='yay', displayname='My shiny new PPA', description='Shinyness!')
 
22
  ...     name='yay', displayname='My shiny new PPA',
 
23
  ...     description='Shinyness!'))
23
24
  HTTP/1.1 201 Created
24
25
  Status: 201
25
26
  ...
26
27
  Location: http://api.launchpad.dev/.../+archive/ubuntu/yay
27
28
  ...
28
29
 
29
 
  >>> print ppa_owner_webservice.named_post(
 
30
  >>> print(ppa_owner_webservice.named_post(
30
31
  ...     ppa_owner['self_link'], 'createPPA', {}, name='ubuntu',
31
32
  ...     displayname='My shiny new PPA', description='Shinyness!',
32
 
  ...     )
 
33
  ...     ))
33
34
  HTTP/1.1 400 Bad Request
34
35
  Status: 400 Bad Request
35
36
  ...
45
46
 
46
47
They aren't a commercial admin, so they cannot create private PPAs.
47
48
 
48
 
  >>> print ppa_owner_webservice.named_post(
 
49
  >>> print(ppa_owner_webservice.named_post(
49
50
  ...     ppa_owner['self_link'], 'createPPA', {}, name='whatever',
50
51
  ...     displayname='My secret new PPA', description='Secretness!',
51
52
  ...     private=True,
52
 
  ...     )
 
53
  ...     ))
53
54
  HTTP/1.1 400 Bad Request
54
55
  Status: 400
55
56
  ...
71
72
 
72
73
Once they have commercial access, they can create private PPAs:
73
74
 
74
 
  >>> print ppa_owner_webservice.named_post(
 
75
  >>> print(ppa_owner_webservice.named_post(
75
76
  ...     ppa_owner['self_link'], 'createPPA', {}, name='secret',
76
77
  ...     displayname='My secret new PPA', description='Secretness!',
77
78
  ...     private=True,
78
 
  ...     )
 
79
  ...     ))
79
80
  HTTP/1.1 201 Created
80
81
  Status: 201
81
82
  ...
98
99
 
99
100
It's possible to create PPAs for all sorts of distributions.
100
101
 
101
 
  >>> print ppa_owner_webservice.named_post(
 
102
  >>> print(ppa_owner_webservice.named_post(
102
103
  ...     ppa_owner['self_link'], 'createPPA', {}, distribution='/ubuntutest',
103
 
  ...     name='ppa')
 
104
  ...     name='ppa'))
104
105
  HTTP/1.1 201 Created
105
106
  Status: 201
106
107
  ...
109
110
 
110
111
But not for distributions that don't have PPAs enabled.
111
112
 
112
 
  >>> print ppa_owner_webservice.named_post(
 
113
  >>> print(ppa_owner_webservice.named_post(
113
114
  ...     ppa_owner['self_link'], 'createPPA', {}, distribution='/redhat',
114
 
  ...     name='ppa')
 
115
  ...     name='ppa'))
115
116
  HTTP/1.1 400 Bad Request
116
117
  Status: 400
117
118
  ...
124
125
method, so they remain optional and default to Ubuntu and "ppa"
125
126
respectively.
126
127
 
127
 
  >>> print ppa_owner_webservice.named_post(
128
 
  ...     ppa_owner['self_link'], 'createPPA', {})
 
128
  >>> print(ppa_owner_webservice.named_post(
 
129
  ...     ppa_owner['self_link'], 'createPPA', {}))
129
130
  HTTP/1.1 201 Created
130
131
  Status: 201
131
132
  ...