这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
deabe59
typo in the GitHub workflow
flovntp Aug 21, 2025
e8d718e
first test on mustache templates
flovntp Aug 22, 2025
e122f24
cleaning openapi classes
flovntp Aug 22, 2025
815cd08
typo
flovntp Aug 22, 2025
a7a0bfc
typo
flovntp Aug 22, 2025
de3ee13
type Filter in API call
flovntp Aug 22, 2025
8c58be6
add debug on regionAPI
flovntp Aug 22, 2025
9e818a8
solve null filters
flovntp Aug 22, 2025
b6323a9
debug regionApi
flovntp Aug 22, 2025
87176d5
JsonSerialize
flovntp Aug 22, 2025
aadcb6d
revert jsonSerialize
flovntp Aug 22, 2025
e1e9ca5
jsonSerialise issue
flovntp Aug 22, 2025
a32c539
debug
flovntp Aug 22, 2025
ce63768
debug
flovntp Aug 22, 2025
4b2dfab
debug
flovntp Aug 22, 2025
deae47e
debug
flovntp Aug 22, 2025
e5bae81
debug
flovntp Aug 22, 2025
b525cdd
debug
flovntp Aug 22, 2025
30aaace
debug
flovntp Aug 22, 2025
4da4209
test with additional refreshtoken
flovntp Aug 22, 2025
2e6c8e1
test with additional refreshtoken
flovntp Aug 22, 2025
014ecea
debug createproject
flovntp Aug 22, 2025
d8b1c88
debug createproject
flovntp Aug 22, 2025
09a9c00
debug createproject
flovntp Aug 22, 2025
5b80faa
debug createproject
flovntp Aug 22, 2025
8be7ed3
debug createproject
flovntp Aug 22, 2025
9410062
debug
flovntp Aug 22, 2025
a9577cc
debug
flovntp Aug 22, 2025
b72e96e
switch delete project to delete subscription endpoint
flovntp Aug 22, 2025
8e683c3
new version with php doc ok
flovntp Aug 25, 2025
224d3f3
merge main
flovntp Aug 25, 2025
30e83a9
Remove composer.lock
fabpot Aug 28, 2025
af29bdd
try to remove ->refreshToken(); calls from Tasks (directly from API)
flovntp Aug 28, 2025
c174bc7
Model compatible with ModelInterface
flovntp Aug 28, 2025
5b0d3a3
remove refreshToken from task
flovntp Aug 28, 2025
079920b
UpsunClient: inject OAuthProvider
flovntp Aug 28, 2025
bb74467
adding requestFactory in init of Api in UpsunClient
flovntp Aug 28, 2025
0f8fa02
adding use Ps7/Stream
flovntp Aug 28, 2025
eb4b929
debug OrganizationApi
flovntp Aug 28, 2025
eaa4000
debug OrganizationApi
flovntp Aug 28, 2025
5bb24b6
debug OrganizationApi
flovntp Aug 28, 2025
b83d34f
debug OrganizationApi
flovntp Aug 28, 2025
6914ff9
change ObjectSerialize tostring signature
flovntp Aug 28, 2025
56d3446
adding mustache template for OAuthProvider
flovntp Aug 28, 2025
78901bb
adding dependencies
flovntp Aug 28, 2025
0ef8c77
debug organizationApi
flovntp Aug 28, 2025
98796fd
debug organizationApi
flovntp Aug 28, 2025
3031705
debug organizationApi
flovntp Aug 28, 2025
349b673
debug OrgApi
flovntp Aug 28, 2025
df1804e
debug OrgApi
flovntp Aug 28, 2025
8ae01a1
solve delete project from ProjectTask
flovntp Aug 28, 2025
8319b99
debug OAuthProvider
flovntp Aug 28, 2025
b711268
debug OAuthProvider
flovntp Aug 28, 2025
c8ec7aa
refreshToken refacto
flovntp Aug 28, 2025
c60e919
debug refreshToken
flovntp Aug 28, 2025
5aef01f
store auth token in a variable
flovntp Aug 29, 2025
3b69a05
debug OAuthProvider
flovntp Aug 29, 2025
dc3018c
debug OAuth provider 429 response
flovntp Aug 29, 2025
0585344
debug refreshToken
flovntp Aug 29, 2025
6076456
debug refreshToken
flovntp Aug 29, 2025
3a8733b
debug refreshToken
flovntp Aug 29, 2025
a1fea03
debug refreshToken
flovntp Aug 29, 2025
0e93fb9
debug refreshToken
flovntp Aug 29, 2025
1a13b79
simplified version of Models and Apis
flovntp Aug 29, 2025
154be83
simplified version of Models and Apis
flovntp Aug 29, 2025
7ade5e0
simplified version of Models and Apis
flovntp Aug 29, 2025
e3a4fbc
simplified version of Models and Apis
flovntp Aug 29, 2025
7c9ad68
simplified version of Models and Apis
flovntp Aug 29, 2025
54346e5
simplified version of Models and Apis
flovntp Aug 29, 2025
2c7f4e7
simplified version of Models and Apis
flovntp Aug 29, 2025
48a197f
simplified version of Models and Apis
flovntp Aug 29, 2025
94af1ed
simplified version of Models and Apis
flovntp Aug 29, 2025
20a740a
simplified version of Models and Apis
flovntp Aug 29, 2025
57c7aac
simplified version of Models and Apis
flovntp Aug 29, 2025
9a605d3
main Api function return an array
flovntp Sep 1, 2025
d3765e2
pre-processing + new version of the API specs
flovntp Sep 1, 2025
e4e1981
update README to add the pre-processing php function
flovntp Sep 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
16 changes: 2 additions & 14 deletions .github/workflows/check-openapi-spec-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
- name: Keep existing files (removed by openapi-generator-cli generate)
run: |
mv .gitignore .gitignore.bak
mv README.md README.md.bak
mv composer.json composer.json.bak
mv phpunit.xml.dist phpunit.xml.dist.bak

- name: Download and patch OpenAPI spec
run: |
Expand All @@ -44,13 +41,8 @@ jobs:
- name: Generate code (php)
run: |
export GIT_USER_ID=upsun
export GIT_REPO_ID=upsun-sdk-go
openapi-generator-cli generate \
-i ./schema/openapispec-platformsh.json \
-g php \
-o apisgen \
--additional-properties="apiPackage=.,invokerPackage=Upsun\\Client,apiPackage=Api,modelPackage=Model,srcBasePath=src" \
--library="psr-18"
export GIT_REPO_ID=upsun-sdk-php
openapi-generator-cli generate -c templates/php/config.yaml

- name: Remove empty phpunit tests from OpenAPI Generator
run: |
Expand All @@ -59,11 +51,7 @@ jobs:
fi
- name: Get back existing files (removed by openapi-generator-cli generate)
run: |
mv README.md.bak README.md
mv .gitignore.bak .gitignore
mv composer.json.bak composer.json
rm -Rf phpunit.xml.dist
mv phpunit.xml.dist.bak phpunit.xml.dist

- name: Create Pull Request if changes
uses: peter-evans/create-pull-request@v6
Expand Down
30 changes: 23 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
.env
apisgen/.travis.yml
apisgen/git_push.sh
apisgen/.openapi-generator/
apisgen/.openapi-generator-ignore
vendor
composer.lock
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore
.env
.travis.yml
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock

# php-cs-fixer cache
.php_cs.cache
.php-cs-fixer.cache
.php-cs-fixer.dist.php

# PHPUnit cache
.phpunit.result.cache
test/

openapitools.json
.openapi-generator/
.openapi-generator-ignore
git_push.sh
875 changes: 808 additions & 67 deletions README.md

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "upsun/upsun-sdk-php",
"description": "Upsun SDK for PHP. This SDK maps the Upsun CLI commands. For more information, read [the documentation](https://docs.upsun.com).",
"description": "# Introduction Platform.sh is a container-based Platform-as-a-Service. Our main API is simply Git. With a single `git push` and a couple of YAML files in your repository you can deploy an arbitrarily complex cluster. Every [**Project**](#tag/Project) can have multiple applications (PHP, Node.js, Python, Ruby, Go, etc.) and managed, automatically provisioned services (databases, message queues, etc.). Each project also comes with multiple concurrent live staging/development [**Environments**](#tag/Environment). These ephemeral development environments are automatically created every time you push a new branch or create a pull request, and each has a full copy of the data of its parent branch, which is created on-the-fly in seconds. Our Git implementation supports integrations with third party Git providers such as GitHub, Bitbucket, or GitLab, allowing you to simply integrate Platform.sh into your existing workflow. ## Using the REST API In addition to the Git API, we also offer a REST API that allows you to manage every aspect of the platform, from managing projects and environments, to accessing accounts and subscriptions, to creating robust workflows and integrations with your CI systems and internal services. These API docs are generated from a standard **OpenAPI (Swagger)** Specification document which you can find here in [YAML](openapispec-platformsh.yaml) and in [JSON](openapispec-platformsh.json) formats. This RESTful API consumes and produces HAL-style JSON over HTTPS, and any REST library can be used to access it. On GitHub, we also host a few API libraries that you can use to make API access easier, such as our [PHP API client](https://github.com/platformsh/platformsh-client-php) and our [JavaScript API client](https://github.com/platformsh/platformsh-client-js). In order to use the API you will first need to have a Platform.sh account (we have a [free trial](https://accounts.platform.sh/platform/trial/general/setup) available) and create an API Token. # Authentication ## OAuth2 API authentication is done with OAuth2 access tokens. ### API tokens You can use an API token as one way to get an OAuth2 access token. This is particularly useful in scripts, e.g. for CI pipelines. To create an API token, go to the \"API Tokens\" section of the \"Account Settings\" tab on the [Console](https://console.platform.sh). To exchange this API token for an access token, a `POST` request must be made to `https://auth.api.platform.sh/oauth2/token`. The request will look like this in cURL: <pre> curl -u platform-api-user: \\ -d 'grant_type=api_token&amp;api_token=<em><b>API_TOKEN</b></em>' \\ https://auth.api.platform.sh/oauth2/token </pre> This will return a \"Bearer\" access token that can be used to authenticate further API requests, for example: <pre> { \"access_token\": \"<em><b>abcdefghij1234567890</b></em>\", \"expires_in\": 900, \"token_type\": \"bearer\" } </pre> ### Using the Access Token To authenticate further API requests, include this returned bearer token in the `Authorization` header. For example, to retrieve a list of [Projects](#tag/Project) accessible by the current user, you can make the following request (substituting the dummy token for your own): <pre> curl -H \"Authorization: Bearer <em><b>abcdefghij1234567890</b></em>\" \\ https://api.platform.sh/projects </pre> # HAL Links Most endpoints in the API return fields which defines a HAL (Hypertext Application Language) schema for the requested endpoint. The particular objects returns and their contents can vary by endpoint. The payload examples we give here for the requests do not show these elements. These links can allow you to create a fully dynamic API client that does not need to hardcode any method or schema. Unless they are used for pagination we do not show the HAL links in the payload examples in this documentation for brevity and as their content is contextual (based on the permissions of the user). ## _links Objects Most endpoints that respond to `GET` requests will include a `_links` object in their response. The `_links` object contains a key-object pair labelled `self`, which defines two further key-value pairs: * `href` - A URL string referring to the fully qualified name of the returned object. For many endpoints, this will be the direct link to the API endpoint on the region gateway, rather than on the general API gateway. This means it may reference a host of, for example, `eu-2.platform.sh` rather than `api.platform.sh`. * `meta` - An object defining the OpenAPI Specification (OAS) [schema object](https://swagger.io/specification/#schemaObject) of the component returned by the endpoint. There may be zero or more other fields in the `_links` object resembling fragment identifiers beginning with a hash mark, e.g. `#edit` or `#delete`. Each of these keys refers to a JSON object containing two key-value pairs: * `href` - A URL string referring to the path name of endpoint which can perform the action named in the key. * `meta` - An object defining the OAS schema of the endpoint. This consists of a key-value pair, with the key defining an HTTP method and the value defining the [operation object](https://swagger.io/specification/#operationObject) of the endpoint. To use one of these HAL links, you must send a new request to the URL defined in the `href` field which contains a body defined the schema object in the `meta` field. For example, if you make a request such as `GET /projects/abcdefghij1234567890`, the `_links` object in the returned response will include the key `#delete`. That object will look something like this fragment: ``` \"#delete\": { \"href\": \"/api/projects/abcdefghij1234567890\", \"meta\": { \"delete\": { \"responses\": { . . . // Response definition omitted for space }, \"parameters\": [] } } } ``` To use this information to delete a project, you would then send a `DELETE` request to the endpoint `https://api.platform.sh/api/projects/abcdefghij1234567890` with no body or parameters to delete the project that was originally requested. ## _embedded Objects Requests to endpoints which create or modify objects, such as `POST`, `PATCH`, or `DELETE` requests, will include an `_embedded` key in their response. The object represented by this key will contain the created or modified object. This object is identical to what would be returned by a subsequent `GET` request for the object referred to by the endpoint.",
"keywords": [
"openapitools",
"openapi-generator",
Expand All @@ -13,7 +13,6 @@
],
"homepage": "https://github.com/upsun/upsun-sdk-php",
"license": "Apache-2.0",
"type": "library",
"authors": [
{
"name": "Upsun",
Expand Down Expand Up @@ -44,7 +43,7 @@
"nyholm/psr7": "^1.8"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^8.0 || ^9.0",
"friendsofphp/php-cs-fixer": "^3.5",
"guzzlehttp/guzzle": "^7.0",
"php-http/guzzle7-adapter": "^1.0",
Expand All @@ -54,9 +53,7 @@
"psr-4": { "Upsun\\" : "src/" }
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
"psr-4": { "Upsun\\Test\\" : "test/" }
},
"prefer-stable": true,
"scripts": {
Expand Down
Loading